Remove empty lines from output.
Section: sed Line Deletion and Printing
Delete blank lines
bash
bash
sed '/^$/d' file.txtExplanation
A common cleanup step before diffing or processing text.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing sed Line Deletion and Printing