I know I can use -A
, -B
and -C
to show surrounding lines but all of them also show the matching line. What I'm trying to make here is so, in this example file:
foo
bar
I'd be doing something like grep <option> "bar" file
and my output should be
foo
Side note: I know the way of doing it with another grep
or using sed
but I would like to do it just by using one time grep
bar
? what should it return ? – PinkFloyd May 30 '16 at 08:22