Best Citizenships

Shell command remove empty lines in a text file

You can remove empty lines on a fly using “sed” in  a shell.  This is how

sed '/^$/d' input.txt > output.txt

Input:

and
by
but

 

Output:

and
 by
 but