CLOC is a great utility that counts lines of code in your project.
It also shows you how many files, blank lines and comment lines you have. Great stuff!
For Debian / Ubuntu you can install CLOC via:
apt-get install cloc
For CentOS/RHEL you can install CLOC via:
yum install cloc
Running it is simple:
cloc folder/
Here’s an example run, which also excludes a folder (.idea) from appearing in the stats.
cloc chibi-php-github/ --exclude-dir=.idea
32 text files.
32 unique files.
96 files ignored.
http://cloc.sourceforge.net v 1.58 T=1.0 s (26.0 files/s, 1932.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
PHP 26 284 715 933
-------------------------------------------------------------------------------
SUM: 26 284 715 933
-------------------------------------------------------------------------------
To exclude multiple folders, simply comma-separate them:
cloc chibi-php-github/ --exclude-dir=.idea,vendor,node_modules
CLOC needs no configuration and works for many languages!