EricBrian macrumors 6502a Original poster 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 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.