Last Updated: February 25, 2016
·
437
· 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

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside