how to grep multiply strings

Patrick Woo pat at ctycal.UUCP
Tue Feb 5 05:42:21 AEST 1991


In article <531 at ctycal.UUCP>, pat at 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 at cpsc.ucalgary.ca
  Land Information Services                 or
  The City of Calgary       ...{alberta,ubc-cs,uunet}!calgary!ctycal!pat



More information about the Comp.unix.questions mailing list