Friday, April 29, 2011

grep with the find command with the Linux bash shell

use grep's command line option -H to print the filenames when used within the command "find"

find . -name \*.py -exec grep -Hn string_to_search {} \;

No comments:

Post a Comment