← 返回命令列表

Linux command

sloccount 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Count lines in directory

sloccount [src/]

Count with details

sloccount --details [src/]

Duplicate file handling

sloccount --duplicates [src/]

Wide output format

sloccount --wide [src/]

Add effort estimates

sloccount --effort [1.0] [2.5] [src/]

说明

sloccount counts physical source lines of code (SLOC) in software projects. It recognizes many programming languages and provides effort and cost estimates using the COCOMO model. The tool helps measure project size, estimate development effort, and track codebase growth.

参数

--details
Show per-file details.
--duplicates
Count duplicate files.
--crossdups
Count cross-directory duplicates.
--wide
Wide output format.
--effort _a_ _b_
COCOMO effort parameters.
--schedule _a_ _b_
COCOMO schedule parameters.
--personcost _cost_
Annual person cost.
--overhead _rate_
Overhead rate.
--cached
Use cached results from a previous run instead of recalculating.
--append
Add to existing data directory instead of clearing it.
--follow
Follow symbolic links.
--autogen
Count auto-generated source files (normally excluded).
--multiproject
Treat directories as separate projects.
--filecount
Show file counts.
--datadir _dir_
Data directory (default: ~/.slocdata).
--addlang _lang_
Add language.

FAQ

What is the sloccount command used for?

sloccount counts physical source lines of code (SLOC) in software projects. It recognizes many programming languages and provides effort and cost estimates using the COCOMO model. The tool helps measure project size, estimate development effort, and track codebase growth.

How do I run a basic sloccount example?

Run `sloccount [src/]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --details do in sloccount?

Show per-file details.