FILE:
FILE
hello world foo bar
How can I remove all the empty new lines in this FILE?
Output of command:
Here is a solution that removes all lines that are either blank or contain only space characters:
grep -v '^[[:space:]]*$' foo.txt