wc — Display a Count of Lines, Words, and Characters in a File

Synopsis

/usr/bin/wc [-c | -m | -C][-lw][file...] 

Description

Use the wc command to display a count of the lines, words, and characters in a file. The wc command reads one or more input files and, by default, writes the number of newline characters, words, and bytes contained in each input file to the standard output.

The command also writes a total count for all named files if you specify more than one input file.

wc considers a word to be a non-zero-length string of characters delimited by white space such as space or Tab (see iswspace(3C) or isspace(3C)).

Options

-c Count bytes.
-m Count characters.
-C Same as -m.
-l Count lines.
-w Count words delimited by white space characters ...

Get Solaris™ 7 Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.