1

Suppose I have a directory with a list of files having .log extension and i need to find out those log files which do not contain abc. How would we do that?

  • someone else asked the same question not long ago: http://stackoverflow.com/questions/1748129/using-grep-to-find-files-that-doesnt-contain-a-given-string-pattern – endo.anaconda Nov 16 '11 at 11:08

1 Answers1

2
find .  -not  -ipath '.*log' -exec  grep  -H -E -o -c  "abc"  {} \; | grep :0\$

or you could install ack

ack -L foo
endo.anaconda
  • 2,449
  • 4
  • 29
  • 55