How To Install Cloc?

How To Install Cloc?

cloc

Count, and compute differences of, lines of source code and comments.

Maintainer: Jari Aalto



Section: devel

Install cloc

  • Debian apt-get install cloc Click to copy
  • Ubuntu apt-get install cloc Click to copy
  • Alpine OS apk add cloc Click to copy
  • Arch Linux pacman -S cloc Click to copy
  • Kali Linux apt-get install cloc Click to copy
  • Fedora dnf install cloc Click to copy
  • Raspbian apt-get install cloc Click to copy
  • macOS brew install cloc Click to copy

Count, and compute differences of, lines of source code and comments.

How to use cloc?

Below are few example commands for cloc that you can use in the terminal.

Count all the lines of code in a directory:
cloc /path/to/directoryClick to copy
Count all the lines of code in a directory, displaying a progress bar during the counting process:
cloc --progress=1 /path/to/directoryClick to copy
Compare 2 directory structures and count the differences between them:
cloc --diff /directory/one /directory/twoClick to copy
To install the latest version of cloc in your favorite operating system just copy the cloc installation command from above and paste it into terminal. It will download and install the latest version of cloc 2026 package in your OS.