Linux Mastering Development Ubuntu

grep: Show ALL lines before a match

Not only 10, or 7, or 14 for example, as explain in this topic and in many others:
How you do it?

For example, instead of:

... | grep -B 10 -- "foo"

I want:

... | grep -B -- "foo"

But this last code doesn’t work.

Leave a Reply

Your email address will not be published. Required fields are marked *