How to remove blank lines in a file?

grep -v ‘^$’ filename >new_filename

Category: UNIX Interview Questions.