cloc

Count, and compute differences of, lines of source code and comments. More information: <https://github.com/AlDanial/cloc>.

Install

All systems
curl cmd.cat/cloc.sh
Debian Debian
apt-get install cloc
Ubuntu
apt-get install cloc
Alpine
apk add cloc
Arch Arch Linux
pacman -S cloc
image/svg+xml Kali Linux
apt-get install cloc
Fedora
dnf install cloc
Windows (WSL2)
sudo apt-get update sudo apt-get install cloc
OS X
brew install cloc
Raspbian
apt-get install cloc
Docker
docker run cmd.cat/cloc cloc powered by Commando

Count, and compute differences of, lines of source code and comments. More information: <https://github.com/AlDanial/cloc>.

  • Count all the lines of code in a directory:
    cloc path/to/directory
  • Count all the lines of code in a directory, displaying a progress bar during the counting process:
    cloc --progress=1 path/to/directory
  • Compare 2 directory structures and count the differences between them:
    cloc --diff path/to/directory/one path/to/directory/two
  • Ignore files that are ignored by VCS, such as files specified in `.gitignore`:
    cloc --vcs git path/to/directory
  • Count all the lines of code in a directory, displaying the results for each file instead of each language:
    cloc --by-file path/to/directory

© tl;dr; authors and contributors