How to Remove all empty lines in a file on Linux and Windows? Remove empty lines from file.txt via Linux command line Option 1: sed -i ‘/^$/d’ file.txt Option 2: awk ‘NF > 0’ file.txt > output.txt Option 3: perl […] ↓ Read the rest of this entry…