Display line numbers with matches.
Section: Basic grep
Show line numbers
bash
bash
grep -n TODO src/app.jsExplanation
Line numbers make it easier to jump directly to a match.
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 Basic grep