Remove blank lines with grep

后端 未结 15 2025
后悔当初
后悔当初 2020-12-22 17:51

I tried grep -v \'^$\' in Linux and that didn\'t work. This file came from a Windows file system.

15条回答
  •  北海茫月
    2020-12-22 18:28

    egrep -v "^\s\s+"

    egrep already do regex, and the \s is white space.

    The + duplicates current pattern.

    The ^ is for the start

提交回复
热议问题