Print context on both sides of a match.
Section: Context Around Matches
Show lines before and after
bash
bash
grep -C 2 ERROR app.logExplanation
`-C` gives balanced context and is often the most convenient option.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Context Around Matches