Tuesday, December 15, 2009

Counting the lines of code in a project

cd ~/src
find . -name "*.java" -exec wc -l {} \; | awk '{ SUM += $1} END { print SUM }'

this is cool...

1 comment:

  1. No awk needed:

    cd ~/src
    find . -name "*.java" -exec cat {} \; | wc -l

    ReplyDelete