cloc(1) User Commands cloc(1) (NAME) cloc - (SYNOPSIS) cloc [options] ... (DESCRIPTION) ( tarball zip ) / . . (OPTIONS) (Input Options) - --stdin-name=FILE cloc --force-lang=LANG LANG . --extract-with=CMD cloc () . CMD ( .tar.gz .zip .Z) . '>FILE<' () . gcc-4.2.tar.gz perl-5.8.8.tar.gz : --extract-with='gzip -dc >FILE< | tar xf - GNU tar : --extract-with='tar zxf >FILE<' : --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o >FILE< --list-file=FILE / FILE / . cloc . STDIN FILE - . : --exclude-list-file --config. --diff-list-file=FILE (diff) FILE --diff-alignment . ( .) . --diff . : --config. --vcs=VCS VCS . VCS 'git' 'git ls-files' 'git submodule status' . --git . VCS 'svn' 'svn list -R' . cloc ( .gitignore svn:ignore) . VCS . : cloc VCS . cloc . 'svn list -R' ( ) . VCS 'auto' .git .svn cloc 'git' 'svn' ( ) . --unicode . . (Processing Options) --autoconf .in ( GNU autoconf) . --no-autogen . --by-file . --by-file-by-lang . --config FILE FILE ~/.config/cloc/options.txt. ( ) . '#' . . : --list-file --exclude-list-file --read-lang-def --force-lang-def --diff-list-file ~/.config/cloc/options.txt . --count-and-diff SET1 SET2 () SET1 SET2 (diff) . . --out --report-file . --diff --diff-alignment --diff-timeout --ignore-case --ignore-whitespace . --diff SET1 SET2 () SET1 SET2. . --diff-alignment . --count-and-diff --diff-alignment --diff-timeout --ignore-case --ignore-whitespace . --diff-timeout N N . 10 . N 0 . ( Algorithm::Diff::sdiff() .) --docstring-as-code cloc (docstrings) . . --follow-links [ ] ( ). --force-lang=LANG[,EXT] EXT LANG. .f Fortran 90 ( .f90 ) Fortran 77 : --force-lang="Fortran 90",f EXT LANG . ( EXT ). --script-lang --lang-no-ext . --force-lang-def=FILE FILE . : ( : MATLAB/Objective-C/MUMPS Pascal/PHP Lisp/OpenCL Lisp/Julia Perl/Prolog) . --read-lang-def ( --write-lang-def --write-lang-def-incl-dup ). --git ( ) . --vcs=git --git 'git ls-files'. --diff . -v/--verbose cloc . --git-diff-rel --git --diff --diff . . --git-diff-all (git diff): . --ignore-whitespace --diff. --ignore-case . --ignore-case --diff. --ignore-whitespace . --ignore-case-ext . ( .c .C C C++ .C C C++ ). . --ignore-regex () . . (|) . * . : --ignore-regex='C,Java,C++|^\s*[{};]\s*$' --ignore-regex='*|DEBUG|TEST\s+ONLY' . --strip-comments=EXT . . --include-submodules --vcs=git . --lang-no-ext=LANG LANG. ( "#!" ). --force-lang --script-lang . --max-file-size=MB "MB" . "MB" . cloc . : . --no-autogen[=list] GNU autoconf. ( ) --no-autogen list . --autoconf . --no-recurse . --only-count-files . . --original-dir --strip-comments . ( ) . --read-binary-files . . --read-lang-def=FILE FILE cloc . FILE cloc cloc . cloc --force-lang-def ( --write-lang-def ). --script-lang=LANG,S "S" "#!" LANG. "#!/usr/local/bin/perl5.8.8" Perl : --script-lang=Perl,perl5.8.8 "S" . . --force-lang . --sdir=DIR DIR (scratch) File::Temp . ( File::Temp). --skip-leading=N[,ext] . . : --skip-leading=10,cpp,h *.cpp *.h . . --skip-uniqueness . ( ). --stat (AFS CD-ROM FAT HPFS SMB) ('nlink') . cloc . File::Find stat . . --follow-links . --stdin-name=FILE (STDIN) FILE . --strip-code=EXT . ".EXT" . --original-dir . --strip-comments=EXT ( ). ".EXT" . --original-dir . --strip-str-comments 'xx'. Regexp::Common::Comment 'Complex regular subexpression recursion limit' . : . . --strip-comments . --sum-reports --report-file . . --timeout=N . . N 0 . --diff-timeout . --processes=NUM [ Parallel::ForkManager . .] cloc . 0 . --unix (UNIX). --windows --show-os . --use-sloccount SLOCCount c_count java_count pascal_count php_count xml_count cloc . SLOCCount cloc . cloc : --diff --count-and-diff --strip-comments --unicode. --windows . --unix --show-os . (Filter Options) --include-content=REGEX . --exclude-content=REGEX . --exclude-dir=DIR1[,DIR2 ...] . : --exclude-dir=.cache,test "/.cache/" "/test/" . ".bzr" ".cvs" ".hg" ".git" ".svn" . . --fullpath --not-match-d=REGEX . --exclude-ext=EXT1[,EXT2 ...] . --exclude-lang=L1[,L2[...]] . --exclude-list-file=FILE / FILE . FILE . cloc . --list-file --config . --fullpath --match-f --not-match-f (basename) . ( cloc .) --include-ext= ( ) . --show-ext . --include-lang=L1[,L2 ...] L1 L2 L3 . --match-d=REGEX . : --match-d='/(src|include)/' "/src/" "/include/" . --not-match-d=REGEX . "/usr/local/lib" "lib" . --fullpath . . . --match-f=REGEX . Widget widget : --match-f='^[Ww]idget' --fullpath . --not-match-f=REGEX . --fullpath . . --skip-archive=REGEX . : --skip-archive='(zip|tar(\.(gz|Z|bz2|xz|7z))?)' .zip .tar .tar.gz .tar.Z .tar.bz2 .tar.xz .tar.7z . --skip-win-hidden . (Debug Options) --categorized=FILE FILE. --counted=FILE FILE. --found --ignored --unique . --diff-alignment=FILE FILE --diff / . --diff . --explain=LANG LANG . . . --help cloc . --found=FILE FILE. --counted --ignored --unique . --ignored=FILE FILE. --counted --found --unique . --print-filter-stages STDOUT . --show-ext[=EXT] ( ) . --show-errors[=EXT] --quiet ( ) . --show-lang[=LANG] ( ) . --show-os . --unix --windows . --quiet . --show-errors . --unique=FILE FILE. --counted --found --ignored . -v[=N] . --verbose[=N] -v. --version . --write-lang-def=FILE FILE . . : . --force-lang-def --read-lang-def . --write-lang-def-incl-dup=FILE --write-lang-def . cloc . (Output Options) --3 . ( .) --by-percent X X X : c cm + cb + cmb + + 'c' . . --csv (CSV). --csv-delimiter=C C CSV (,). --csv . --file-encoding=E E (E = 'UTF-7'). : 'UTF-16' 'euc-kr' 'iso-8859-16'. : perl -MEncode -e 'print join("\n", Encode->encodings(":all")), "\n"' --fmt=N N - - . 'total lines' . JSON . JSON --out/--report-file . : 1: ( cloc) 2: 3: 4: 5: --hide-rate . (deterministic) . --json (JSON). --md (Markdown). --out=FILE --report-file=FILE. --progress-rate=N N ( N=100). N 0 STDOUT . --quiet . --report-file=FILE FILE . --summary-cutoff=X:N X N 'Other' ( ) X : c f m cm + N . --diff --by-file . --sql=FILE SQL CREATE INSERT SQLite . FILE - STDOUT . --sql-append SQL (INSERT) --sql (CREATE TABLE). --sql-project=NAME name . --sql . --sql-style=STYLE SQL SQLite. Oracle Named_Columns . --sum-one SUM: . --xml XML. --xsl[=FILE] FILE XSL XML. FILE cloc.xsl . --xml . --yaml YAML. (EXAMPLES) tar 5.10.0 : cloc perl-5.10.0.tar.gz 2.6.6 2.7 : cloc --diff Python-2.6.6.tar.bz Python-2.7.tar.bz2 cloc --diff-alignment=FILE . "align.txt" : cloc --diff-alignment=align.txt gcc-4.4.0.tar.bz2 gcc-4.5.0.tar.bz2 : cloc --git --diff b409850824 HEAD : cloc --show-lang "foo.c" "foo.c.nc" ( "nc" " " ): cloc --strip-comments=nc foo.c . (ENVIRONMENT) . (FILES) . (SEE ALSO) sloccount(1) (AUTHORS) cloc Al Danial (C) 2006-2026 . Jari Aalto . (GNU GPL) ( ) . . cloc 2026-02-04 cloc(1)