Counting lines of code 

To measure the lines of code in a codebase (on a standard Linux machine):

find -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.hpp" | while read i; do wc -l "$i"; done | cut -d " " -f 1 | awk '{total = total + $1}END{print total}'


The while read is needed to join together file names with spaces (versus using -exec wc -l {} \;).
[ add comment ] ( 83 views ) permalink

<<First <Back | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Next> Last>>