Quantcast
Channel: shell script – PCtechtips.org
Viewing all articles
Browse latest Browse all 17

Two Ways to Remove Blank Lines from a File in Bash

$
0
0
Removing blank lines from a file is very simple in bash. Here are two ways in which this can be accomplished using “sed” and “grep” sed -i '/^$/d' filename and grep -v '^$' inputfile > outputfile

Viewing all articles
Browse latest Browse all 17

Trending Articles