Grep Recursively

The following command will search your hard drive for a specific file type *.php and then execute the grep command on each of those files. The -Hn switches will show the file name and the line number for each match.

find . -name "*.php" -exec grep -Hn "its_db.php" {} \;
 
linux/grep_recursively.txt · Last modified: 2011/01/10 12:00 by Joel Dare
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki