Search with anchors.
Section: Regex with grep
Match line start and end
bash
bash
grep '^ERROR.*timeout$' app.logExplanation
Anchors let you constrain a match to the full line shape.
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 Regex with grep
Use extended regex
Enable `+`, `?`, and alternation without heavy escaping.
Find non-blank lines
Show lines containing at least one non-space character.