Section: Regex with grep

Match line start and end

bash
bash
grep '^ERROR.*timeout$' app.log
Explanation

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.
OpenIn sheetbashsame section
Match literal text only
Disable regex interpretation.
OpenIn sheetbashsame section
Find blank lines
Search for empty lines.
OpenIn sheetbashsame section
Find non-blank lines
Show lines containing at least one non-space character.
OpenIn sheetbashsame section
Search for a word
Print lines containing a pattern.
OpenIn sheetbash1 tag match
Search recursively
Search all files under a directory.
OpenIn sheetbash1 tag match