26Apr 2006 How do I remove blank lines from a file? by troyski ⋅ Leave a Comment You can use sed to do this but by far the easiest way is the following grep example: cat $file | grep -v '^$'cat $file | grep -v '^$' Perfick!