Remove empty lines in a text file via grep

后端 未结 11 1667
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-12 23:17

FILE:

hello

world

foo

bar

How can I remove all the empty new lines in this FILE?

Output of command:

11条回答
  •  萌比男神i
    2020-12-12 23:51

    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)

提交回复
热议问题