Skip to content

Instantly share code, notes, and snippets.

@mjavadhpour
Last active May 5, 2018 03:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjavadhpour/5db60844c1f0153836e4fdca42499f53 to your computer and use it in GitHub Desktop.
Save mjavadhpour/5db60844c1f0153836e4fdca42499f53 to your computer and use it in GitHub Desktop.
How to count all the lines of code in a directory recursively?
$ find . -name '*.php' | xargs wc -l
$ find . -name '*.js' -or -name '*.php' | xargs wc -l | grep 'total'  | awk '{ SUM += $1; print $1} END { print "Total text lines in PHP and JS",SUM }'
$ cloc --exclude-lang=DTD,Lua,make,Python .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment