Counting lines, words and characters
The wc command displays the number of lines, words and
characters in a file.
The syntax for the wc is
wc filename
For example, the command wc my_speech might give you
something like the following:
unity% wc my_speech
1018 6407 43366 my_speech
unity%
This means that "my_speech" has 1018 lines, 6407 words and 43366 characters
in it.
If you can't remember which value means what, just remember that you
can use options (l, w, c) to get only the value you desire.
l to count lines.
w to count words.
c to count characters.
For instance, the command
wc -w my_speech
will return only the number of words in the speech, in this case 6407.
Last modified
July 20, 2004
by cawalker
|