wc [-c|-m] [-lw] [file ...]
Wc determines the number of lines, words and characters contained
in each file and writes the count in that order to standard output,
separated by spaces and followed by the filename. If no file argument
is given, standard input is used and no filename is printed. If more than
one input file was processed successfully, a grand total for all files is
printed in the line of output.
The wc command accepts the following options; if any of
them is present, output is restricted to the specified fields:
- -c
- Print the number of bytes.
- -l
- Print the number of lines (i. e. newline characters).
- -m
- Print the number of characters instead of the number of bytes. The number
of characters equals the number of bytes in singlebyte locales. In
multibyte locales, this is the count of byte sequences forming a valid
character. This option was introduced by POSIX.2.
- -w
- Print the number of words. With /usr/local/heirloom/usr/5bin/wc and
/usr/local/heirloom/usr/5bin/s42/wc, a word is a string of
characters that contains at least one graphical character and is delimited
by blank or newline characters. With
/usr/local/heirloom/usr/5bin/posix/wc and
/usr/local/heirloom/usr/5bin/posix2001/wc, a word is a nonempty
string of characters that is delimited by white space.
- LANG, LC_ALL
- See locale(7).
- LC_CTYPE
- Determines the byte sequences that form a character for the -m
option and for the interpretation of white space, graphical characters and
newlines.