V Vy Bùi New member Jan 6, 2022 #1 How do I remove blank lines in Unix? Answer Simple solution is by using grep (GNU or BSD) command as below. Remove blank lines (not including lines with spaces). grep . file.txt. Remove completely blank lines (including lines with spaces). grep “S” file.txt.
How do I remove blank lines in Unix? Answer Simple solution is by using grep (GNU or BSD) command as below. Remove blank lines (not including lines with spaces). grep . file.txt. Remove completely blank lines (including lines with spaces). grep “S” file.txt.