Show lines around each match
Prints each matching line together with the given number of lines before and after it.
grep -C 3 "pattern" fileEdit the highlighted values, then copy. They are inserted as typed, without shell escaping.
Report an issue (opens in a new tab) wrong command, wrong danger level, typo… (on GitHub)
Adapted from tldr-pages (common/grep.md), licensed under CC BY 4.0.