How can i search for files which contain string A but not string B ?

Pipe the output of grep through grep -v. For example:

grep 'A' file | grep -v 'B'

Leave a Reply