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
Written by Sergey Zabolotnov
Related protips
2 Responses
Another way to do this https://coderwall.com/p/ap8i-w
over 1 year ago
·
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#