Negative matching using grep (match lines that do not contain foo)

Viewed 1112632

How do I match all lines not matching a particular pattern using grep? I tried this:

grep '[^foo]'
3 Answers
Related