Using grep to find files that doesn't contain a given string pattern

Posted by Senthil Kumar on Stack Overflow See other posts from Stack Overflow or by Senthil Kumar
Published on 2009-11-17T11:07:14Z Indexed on 2010/04/07 22:33 UTC
Read the original article Hit count: 292

Filed under:
|
|
|
|

I'm using the following command in my web application to find all files in the current directory that contain the string foo (leaving out svn directories).

find .  -not  -ipath '.*svn*' -exec  grep -H -E -o  "foo"  {} \; > grep_results.txt

How do I find out the files that doesn't contain the word foo?

© Stack Overflow or respective owner

Related posts about grep

Related posts about find