Grepping for Blank Lines

A quick regex to grep for blank lines in a text document

cat test.txt |egrep -v '^( | )*$'

The trick is to invoke 'visual mode' when entering the command - right after the second 'pipe' character press Ctrl-v Ctrl-i to place a tab control character in the text - You could also grep for return characters with ctrl-v ctrl-m.

In plain english following egrep:
-v = skip lines matching the pattern
the pattern is in single quotes
^ = the beginning of the line
( | ) = either a space or a tab character - see note above.
* = matches the previous character zero or more times
$ = the end of the line.