Skip to content

Instantly share code, notes, and snippets.

@tanema
Created May 27, 2013 19:38
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 tanema/5658738 to your computer and use it in GitHub Desktop.
Save tanema/5658738 to your computer and use it in GitHub Desktop.
Get the number of lines of code by extension, on a git repo.
git ls-files | perl -pe "s/.*\.(.*?)\n/\.\1\n/" | awk '/\..*/' | sort | uniq | xargs -n1 -E '\n' -I % sh -c 'git ls-files "*%" | xargs cat | echo "$(wc -l) %"' | sort -rn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment