Archive for December, 2008|Monthly archive page

[bash] counting lines

It happened that I needed to count all lines of code in all java/jsp files of a project. What faster than bash can do this?

$ find -type f -iregex ‘.+\.j\(sp\|ava\)$’ -print0 | xargs -0 wc -l

However this wont skip the blank lines.