bash strip empty line from textfile code example Example: sed remove empty lines sed '/^$/d' /tmp/data.txt