User Commands wc(1) NAME wc - display a count of lines, words and characters in a file SYNOPSIS /usr/bin/wc /usr/bin/wc [ options ] [file ...] ksh93 wc [ options ] [file ...] DESCRIPTION wc reads one or more input files and, by default, for each file writes a line containing the number of newlines, words, and bytes contained in each file followed by the file name to standard output in that order. A word is defined to be a non-zero length string delimited by iswspace(3C) or isspace(3C) characters. If more than one file is specified, wc writes a total count for all of the named files with total written instead of the file name. By default, wc writes all three counts. Options can specified so that only certain counts are written. The options -c and -m are mutually exclusive. If no file is given, or if the file is -, wc reads from standard input and no filename is written to standard output. The start of the file is defined as the current offset. OPTIONS The following options are supported: -l, --lines List the line counts. -w, --words List the word counts. Delimiting characters are Extended Unix Code (EUC) characters from any code set defined by iswspace(). -c, --bytes|chars List the byte counts. -m|C, --multibyte-chars List the character counts. -q, --quiet Suppress invalid multibyte character warnings. -L, --longest-line|max-line-length List the longest line length. --man, --html, --nroff Prints builtin manual page in either plain text, HTML or nroff format. --help Prints basic help information --version Prints version information If no option is specified, the default is -lwc (counts lines, words, and bytes.) OPERANDS The following operand is supported: SunOS 5.10 Last change: 20 Dec 1996 1 User Commands wc(1) file A path name of an input file. If no file operands are specified, the standard input will be used. USAGE See largefile(5) for the description of the behavior of wc when encountering files greater than or equal to 2 Gbyte ( 2 **31 bytes). ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of wc: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. EXIT STATUS The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| | CSI | Enabled | |_____________________________|_____________________________| | Interface Stability | Standard | |_____________________________|_____________________________| SEE ALSO cksum(1), ksh93(1), isspace(3C), iswalpha(3C), iswspace(3C), setlocale(3C), attributes(5), environ(5), largefile(5), standards(5) SunOS 5.10 Last change: 20 Dec 1996 2