EricBrian macrumors 6502a Original poster Jul 30, 2005 657 8 Feb 20, 2013 #1 How to find all *.py files that have the word "404" and "split" in them starting in the "Documents" folder? Thanks for any help.
How to find all *.py files that have the word "404" and "split" in them starting in the "Documents" folder? Thanks for any help.
mobilehaathi macrumors G3 Aug 19, 2008 9,368 6,361 The Anthropocene Feb 20, 2013 #2 Code: for file in `find ~/Documents -type f -name "*.py"` do if [ -n "`cat $file | grep split`" -a -n "`cat $file | grep 404`" ] then echo $file; fi done Might not be the most efficient, but it ought to work.
Code: for file in `find ~/Documents -type f -name "*.py"` do if [ -n "`cat $file | grep split`" -a -n "`cat $file | grep 404`" ] then echo $file; fi done Might not be the most efficient, but it ought to work.