COMMAND

wc -- count the number of bytes, words, and lines in an input


SYNOPSIS

wc [-clLw] [inputfile ...]


DESCRIPTION

The wc command counts the number of lines, words, and bytes (characters) for each file in the input. Total counts are also given if more than one file is specified. If wc receives input from a pipe (standard input), then the output counts pertain to the entire received input.

By default, wc prints all three counts. Options can specify that only certain counts be printed. Options do not undo others previously given, hence

wc -c -w
prints both the character counts and the word counts.


OPTIONS

The wc command provides the following options:
-hdisplays a help screen summarizing the command syntax
-coutput character count only
-loutput line count only
-Loutput length of longest line
-woutput word count only
--helpdisplays a help screen summarizing the command syntax
Options are specified in the command line.


PORTABILITY

All UNIX systems supporting the DOS 2.0 and up, with UWIN or MKS Toolkit. Apple OSX.


SEE ALSO

census (4), grep -c (UNIX)