1 Answer
To remove only blank lines in files, either awk or sed command could be used.
awk command helps to display the file without blank lines, whereas sed could be used to modify the source file itself...
For example:
Assume test file contains 50 lines with blank lines.
To view only:
#awk 'NF' test
To modify file:
#sed -i '/^$/d' test
Your Answer