Re: Grep for strings NOT matching

From: GreyBeard (
Date: 01/06/05

Date: Thu, 06 Jan 2005 20:20:21 GMT

On Thu, 06 Jan 2005 11:51:47 -0800, Shabam wrote:

> I've been doing this:
> cat filename|grep "hello"
> Where it returns only results with the string "hello" in it. However, I
> want to return results where there are NO strings matching "bye". How do I
> do that?

According to "man grep", the -v option is to 'inVert the sense'.

You might try

        cat filename | grep -v "bye"
or grep -v bye *