DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

wc(1)


wc -- word count

Synopsis

wc [-lwcm] [file . . .]

Description

wc counts the number of newline characters, words, and bytes in the named files, or in the standard input if no file appears. It also keeps a total count for all named files.

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).

Options


-l
Report the number of newline characters (lines).

-w
Report the number of words.

-c
Report the number of bytes.

-m
Report the number of characters.
If none of the options are specified, the default is equivalent to -lwc.

Files


/usr/lib/locale/locale/LC_MESSAGES/uxcore
language-specific message file. (See LANG on environ(5)).

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004