remove empty lines from file shell script code example Example: sed remove empty lines sed '/^$/d' /tmp/data.txt