Count number of blank lines in a file

前端 未结 7 910
抹茶落季
抹茶落季 2021-02-01 01:38

In count (non-blank) lines-of-code in bash they explain how to count the number of non-empty lines.

But is there a way to count the number of blank lines in a file? By

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 02:35

    grep -v '\S' | wc -l
    

    (On OSX the Perl expressions are not available, -P option)

提交回复
热议问题