pydelion.com

sed: remove a line / remove an empty line

To remove empty lines run:

sed '/^$/d' /home/dandelion/itsfile.txt

To remove lines matching the pattern:

sed '/patter/d' /home/dandelion/itsfile.txt

Add -i option to remove in a file itself, instead of printing the output to stdout.

 

Exit mobile version