count (non-blank) lines-of-code in bash

前端 未结 19 1496
耶瑟儿~
耶瑟儿~ 2020-12-07 07:14

In Bash, how do I count the number of non-blank lines of code in a project?

19条回答
  •  情书的邮戳
    2020-12-07 07:50

    This command count number of non-blank lines.
    cat fileName | grep -v ^$ | wc -l
    grep -v ^$ regular expression function is ignore blank lines.

提交回复
热议问题