grep
Table of Contents
An
stands forn
lines “after” the match.Bm
stands form
lines “before” the match.
grep -A1 -B1 pattern file
If both numbers are the same, just use -C
: grep -C1 yourpattern file
Grep multiple lines #
grep 'a\|b' abc.txt
An
stands for n
lines “after” the match.Bm
stands for m
lines “before” the match.grep -A1 -B1 pattern file
If both numbers are the same, just use -C
: grep -C1 yourpattern file
grep 'a\|b' abc.txt