December 1999
Beginner
528 pages
11h 10m
English
Format:
wc options files
Options:
| -c | Print character count |
| -l | Print line count |
| -w | Print word count |
This counts the number of characters or words.
$ who|wc
1 6 46
$ who|wc -l
1
In the first example output the who command is piped through to wc, and the following columns are displayed:
number of lines, number of words, number of characters
In the second example, wc just prints the number of lines.
$ VAR="tapedrive"
echo $VAR | wc -c
10
The number of characters in the string VAR is output.
Read now
Unlock full access