A word is a non-zero-length string of characters delimited by white space. White space is a sequence of characters designated as isspace in the current locale, as set by LC_CTYPE (see LANG on environ(5)). In the C locale, white space is one of the following characters: space, newline, horizontal tab, vertical tab, formfeed, carriage return.
wc processes supplementary code set characters according to the locale specified in the LC_CTYPE environment variable. Supplementary code set characters are ignored as possible white space characters, and in word counts.
The standard output for each file is the same as the output of
printf(1)
given this input:
"%d %d %d %d %s\n" newlines words bytes characters file
By default, wc acts as if all options were specified; that is,
it reports the number of lines, words, bytes, and characters in the file.
If any option is specified, then only the count for that option is
reported.
If no file is given, no file name is printed.
For the totals
line, the file is replaced with the locale's equivalent to
``total'' (in the C locale, total
is written).