how to delete blank lines in a file using shell script code example Example: sed remove empty lines sed '/^$/d' /tmp/data.txt