How can I view in
less from the first instance of some arbitrary string "foo" to the last instance?
This arbitrary string will be on most every line of the log. I don't want to do
grep "foo" bar.log | less because it won't be on each line that's relevant.
Let's say the file is
1 Don't care about 2 Care about (foo) 3 Care about (foo) 4 Care about 5 Care about (foo) 6 Don't care about
I am wondering how to get the following into
2 Care about (foo) 3 Care about (foo) 4 Care about 5 Care about (foo)
grep "foo" bar.log | less will not work because it ignores line 4, which is one I care about.