wc(1) CLIX wc(1)
NAME
wc - Checks word count
SYNOPSIS
wc [-lwc] [file ... ]
FLAGS
-l Counts the number of lines.
-w Counts the number of words.
-c Counts the number of characters.
DESCRIPTION
The wc command counts lines, words, and characters in the specified files,
or in stdin if no files are specified. It also keeps a total count for
all specified files. A word is a maximal string of characters delimited
by spaces, tabs, or newlines.
The l, w, and c flags can be used in any combination to specify that a
subset of lines, words, and characters are to be reported. The default is
-lwc.
When files are specified on the command line, the filenames are displayed
following the counts.
EXAMPLES
1. To count the number of lines, words, and characters in the
/etc/shutdown file, enter:
wc /etc/shutdown
The following line is returned:
133 441 2419 /etc/shutdown
2. To count the number of lines in the /etc/shutdown file, enter:
wc -l /etc/shutdown
The following line is returned:
133 /etc/shutdown
2/94 - Intergraph Corporation 1
wc(1) CLIX wc(1)
3. To count the number of words in the /etc/shutdown file, enter:
wc -w /etc/shutdown
The following line is returned:
441 /etc/shutdown
4. To count the number of characters in the /etc/shutdown file, enter:
wc -c /etc/shutdown
The following line is returned:
2419 /etc/shutdown
DIAGNOSTICS
wc: cannot open file
The wc command cannot access file.
EXIT VALUES
The wc command exits with a nonzero value if it an error occurs accessing
any of the files in the name list.
2 Intergraph Corporation - 2/94