Remove empty lines from file
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.