Cloc
Count Lines of Code.
Install via package manager
Depending your operating system, one of these installation methods may work for you:
$ npm install -g cloc # https://www.npmjs.com/package/cloc
$ sudo apt-get install cloc # Debian, Ubuntu
$ sudo yum install cloc # Red Hat, Fedora
$ sudo pacman -S cloc # Arch
$ sudo pkg install cloc # FreeBSD
$ sudo port install cloc # Mac OS X with MacPorts
$ brew install cloc # Mac OS X with Homebrew
Create Custom Language Definitions
Create cloc def file:
Read cloc def file:
Simple example
C++
filter remove_matches ^\s*//
filter call_regexp_common C
extension C
extension cc
extension cpp
extension cxx
extension pcc
3rd_gen_scale 1.51
See also
- CCCC
- wc
- Tokei
- Source lines of code (SLOC), also known as lines of code (LOC)