Count LoC for all files in a folder

Count the number of lines for all files in a given folder using find, wc and awk.
created by on 2014-01-03
find . -type f -not -iwholename '*.git*' -exec wc -l {} \; | awk '{print $1}' | awk '{s+=$1} END {print s}'

or

find . -type f -not -iwholename '*.git*' -exec wc -l {} \; | awk '{s+=$1} END {print s}'

Links

Tags:
Fork allmark on GitHub