sed '/^$/d' /path/to/input/file.txt > output.txt grep -v '^$' /path/to/input/file.txt > output.txt
#!/bin/bash files="/path/to/input/files/*.txt" for i in $files do sed '/^$/d' $i > $i.out mv $i.out $i done
#!/bin/bash files="/path/to/input/files/*.txt" for i in $files do sed '/^ *$/d' $i > $i.out mv $i.out $i done