4 ms·
You could do this with grep or ack or ag: grep bar -A 5 -B 5 files... | grep foo -A n prints n lines following the match (bar) and -B n prints n lines befor
by ekns 13y ago
You could do this with grep or ack or ag:
grep bar -A 5 -B 5 files... | grep foo
-A n prints n lines following the match (bar) and -B n prints n lines before the match.
- bencoder 13y ago-C x does the same as both -A x and -B x together (A - after, B - before, C - context)