Remove empty lines in a text file via grep

grep, linux, text-processing

Solution

`grep . FILE`

(And if you really want to do it in sed, then: `sed -e /^$/d FILE`)

(And if you really want to do it in awk, then: `awk /./ FILE`)

Problem

`FILE`: ``` hello world foo bar ``` How can I remove all the empty new lines in this `FILE`? Output of command: `FILE`: ``` hello world foo bar ```

Original source

Related problems