Skip to main content
edited tags
Link
enzotib
  • 53.4k
  • 14
  • 126
  • 106
added 108 characters in body
Source Link
rahmu
  • 20.6k
  • 30
  • 90
  • 128

Is there a simpler way to do this? grep -v foo file | grep -v bar

There're probably very elegant ways to do it with egrep, but how to go with plain old grep?

EDIT: grep -v 'foo\|bar' file seems to work only with GNU grep. I'm on Solaris. Any solution for that?

Is there a simpler way to do this? grep -v foo file | grep -v bar

There're probably very elegant ways to do it with egrep, but how to go with plain old grep?

Is there a simpler way to do this? grep -v foo file | grep -v bar

There're probably very elegant ways to do it with egrep, but how to go with plain old grep?

EDIT: grep -v 'foo\|bar' file seems to work only with GNU grep. I'm on Solaris. Any solution for that?

Source Link
rahmu
  • 20.6k
  • 30
  • 90
  • 128

Using grep -v on multiple arguments

Is there a simpler way to do this? grep -v foo file | grep -v bar

There're probably very elegant ways to do it with egrep, but how to go with plain old grep?