Show lines containing at least one non-space character.
Section: Regex with grep
Find non-blank lines
bash
bash
grep -n '[^[:space:]]' file.txtExplanation
Useful when skipping whitespace-only lines.
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