[email protected]:~$ man cloc

← cd ..
cloc logo

cloc

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.

★ 23.7KGPL-2.0v2.10PerlDevelopment Tools

INSTALLATION

$ brew install cloc
cloc demo

DESCRIPTION

cloc ("Count Lines of Code") is a command-line utility written in Perl that counts blank lines, comment lines, and physical lines of source code across hundreds of programming languages.

Key features include:

  • Broad Support: It recognizes and parses code stats for a vast array of languages, handling differences in single-line and multi-line comment styles automatically.

  • Flexible Inputs: It can analyze individual source files, entire directories, specific git commits/repositories, and compressed archive formats (like .zip, .tar.gz, .deb, .rpm, or .whl files).

  • Code Differences: It can compare two versions of a codebase to compute the delta in blank lines, comments, and actual code.

  • Portability: Written in pure Perl with minimal external dependencies, it runs across Linux, macOS, BSD variants, and Windows (where standalone compiled .exe binaries are also available).

DETAILS

Repository
AlDanial/cloc (2026-10-26)
Author
AlDanial
License
GPL-2.0
Category
Development Tools
Language
Perl
Platforms
Linux, macOS, Windows
Version
v2.10 (2026-07-04)
Repo Age
11 years old

STAR HISTORY

Star history chart for AlDanial/cloc

TAGS

  • cloc
  • count-lines
  • programming-language

SEE ALSO

BADGE

Maintain cloc? Add this badge to your README: listings that link back are marked verified and ranked first in the directory. It's checked once a day.

cloc on The Terminal Index

[+] show code[−] hide code
Markdown
[![cloc on The Terminal Index](https://cli.masoko.net/badge/cloc.svg)](https://cli.masoko.net/tools/cloc/)
HTML
<a href="https://cli.masoko.net/tools/cloc/"><img src="https://cli.masoko.net/badge/cloc.svg" alt="cloc on The Terminal Index"></a>

RELATED TOOLS