wc
PURPOSE
Counts the number of lines, words, and characters in a
file.
SYNOPSIS
wc [ -lwc ] [ names ]
DESCRIPTION
The wc command counts the number of lines, words, or
characters in file or in the standard input if you do not
specify any files. It writes the results to standard
output. It also keeps a total count for all named files.
A word is defined as a string of characters delimited by
spaces, tabs, or new-line characters. wc counts lines,
words, and characters by default.
When you specify more than one file on the command line,
wc displays the name of the file along with the counts.
FLAGS
-c Counts bytes.
-l Counts lines.
-w Counts words.
EXAMPLES
1. To display the line, word, and character counts of a
file:
wc chap1
This displays the number of lines, words, and charac-
ters in the file "chap1".
2. To display only character and word counts:
wc -cw chap*
This displays the number of characters and words in
each file whose name starts with "chap", and displays
the totals.