Remove empty lines from file

September 22nd, 2010 | Tags:

Here’s a quick way to remove empty lines from a file using the Linux command line:

cat file1 | sed /^$/d > file2

Where file1 is the input file containing empty lines and file2 is a newly created file with empty lines removed.

No comments yet.