wc(1) User Commands wc(1)NAMEwc - display a count of lines, words and characters in a file
SYNOPSIS
/usr/bin/wc
/usr/bin/wc [options][file...]
ksh93
wc [options][file...]
DESCRIPTIONwc 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 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 -c and -m options are mutually
exclusive.
If no file is specified, 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:
-c
--bytes | chars
List the byte counts.
-l
--lines
List the line counts.
-L
--longest-line | max-line-length
List the longest line length.
-m | C
--multibyte-chars
List the character counts.
-q
--quiet
Suppress invalid multibyte character warnings.
-w
--words
List the word counts. Delimiting characters are Extended Unix Code
(EUC) characters from any code set defined by isspace(3C).
--help
Prints basic help information.
--man
--html
--nroff
Prints built-in manual page in either plain text, HTML or nroff
format.
--version
Prints version information.
If no option is specified, the default is -lwc (counts lines, words,
and bytes.)
OPERANDS
The following operand is supported:
file A path name of an input file. If no file operands are speci‐
fied, the standard input is used.
USAGE
See largefile(5) for the description of the behavior of wc when encoun‐
tering 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
0 Successful completion.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
┌─────────────────────────────┬─────────────────────────────┐
│ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
├─────────────────────────────┼─────────────────────────────┤
│Availability │SUNWcs │
├─────────────────────────────┼─────────────────────────────┤
│CSI │Enabled │
├─────────────────────────────┼─────────────────────────────┤
│Interface Stability │Committed │
├─────────────────────────────┼─────────────────────────────┤
│Standard │See standards(5). │
└─────────────────────────────┴─────────────────────────────┘
SEE ALSOcksum(1), ksh93(1), isspace(3C), iswalpha(3C), iswspace(3C), setlo‐
cale(3C), attributes(5), environ(5), largefile(5), standards(5)SunOS 5.11 29 Nov 2009 wc(1)