CyberKeeda In Social Media

BASH : How to delete blank lines from a file using SED.






A quick one liner to delete blank lines from a file

cybeerkeeda@Linux-Maniac:~ cat /tmp/hosts.txt

myhost0058x

myhost0070x

myhost0077x

myhost0078x

myhost0079x




I will be using this file later on within LOOPS and intended blank spaces will be avoided.
Below mentioned SED one liner will sort out the requirement
cybeerkeeda@Linux-Maniac:~ sed -i '/^$/d' /tmp/host.txt




No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
Designed By Kunal Saha