SLOC(1)

NAME
sloc - count lines of code in C source files

SYNOPSIS
sloc file [...]

DESCRIPTION
The sloc program counts the non-comment & non-blank lines in a C source file. If multiple files are given on the command line, each file is counted separately, but a totals line is printed after the last file is counted.

BUGS
Sloc uses cc(1) ( cc -E, to be precise) to strip out comments, and expects that cpp(1) will return output annotated with # line directives. If cpp doesn't return that kind of output, sloc will cheerfully tell you that the file doesn't contain any lines of C source.

Counting non-blank code lines may not be the most useful metric.

SEE ALSO
cc(1), cpp(1).

AUTHOR
David Parsons (orc@pell.chi.il.us)