Last Updated: February 25, 2016
·
214
· edinella

Simple LOC (lines of code) report

Is easy to filter specific file extension:

find . -name '*.php' | xargs wc -l

Or multiple file extensions:

find . -name '*.php' -o -name '*.inc' | xargs wc -l

For a Node.js project we can also ignore specific dir:

find . -name '*.js' -not -path './node_modules/*' | xargs wc -l

Or we can ignore multiple dirs:

find . -name '*.js' -not -path '*/node_modules/*' -not -path '*/bower_components/*' | xargs wc -l