e9tf6a
Last Updated: February 25, 2016
·
425
· zabolotnov87

Total lines of code

Problem

Suppose we need to know total lines of code for our git repo

Solution

git ls-files | xargs file | awk 'BEGIN { FS = ":" } ; $2~/text$/ {print $1}' | xargs cat | sed '/^\s*$/d' | wc -l

2 Responses
Add your response

14735

Another way to do this https://coderwall.com/p/ap8i-w

over 1 year ago ·
19299

It would be better if we could exclude the libraries from this count. For eg: JS libraries that you didn't write.

over 1 year ago ·