Issue
In Bash, how do I count the number of non-blank lines of code in a project?
Solution
cat foo.c | sed '/^\s*$/d' | wc -l
And if you consider comments blank lines:
cat foo.pl | sed '/^\s*#/d;/^\s*$/d' | wc -l
Although, that's language dependent.
Answered By - Michael Cramer Answer Checked By - Marie Seifert (WPSolving Admin)