Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!mintaka!mit-eddie!uw-beaver!ubc-cs!alberta!alberta!cpsc.ucalgary.ca!ctycal!pat From: pat@ctycal.UUCP (Patrick Woo) Newsgroups: comp.unix.questions Subject: Re: how to grep multiply strings Keywords: grep regular expression Message-ID: <533@ctycal.UUCP> Date: 4 Feb 91 18:42:21 GMT References: <531@ctycal.UUCP> Organization: The City of Calgary, Ab Lines: 15 In article <531@ctycal.UUCP>, pat@ctycal.UUCP (Patrick Woo) writes: > I am trying to display line that doesn't contain string1 or string2 or ... > stringn. > > grep -v string1 | grep -v string2 | .... | grep -v stringn > Just wondering if there is an easier way other than doing all this piping. Thanks for all the replies, here is the summary egrep -v 'string1|string2| ... | stringN' sed -e '/string1/d' -e 'string2/d' ... -e '/stringN/d' -- Patrick Woo pat%ctycal@cpsc.ucalgary.ca Land Information Services or The City of Calgary ...{alberta,ubc-cs,uunet}!calgary!ctycal!pat