How to remove blank lines in a file?

grep -v ‘^$’ filename >new_filename

Related Questions

Category: UNIX Interview Questions.