Search for empty lines.
Section: Regex with grep
Find blank lines
bash
bash
grep -n '^$' file.txtExplanation
Helpful for validating formatting or splitting sections.
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.