February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Counts the lines, words, characters, and bytes in a file.
Syntax
wc [-c | -m] [-lw] [file...]
Options
-c counts bytes.
-l counts lines.
-m counts characters.
-w counts words.
Oddities
Words are separated by whitespace.
Example
$ wc buzz* # Lines, words, chars
6 9 47 buzz
11 18 90 buzz1
6 9 47 buzz10
16 31 152 buzz2
12 22 116 buzz3
16 33 165 buzz4
67 122 617 total
$
$ wc -l buzz # Lines only
6 buzz
$
$ ps laxw | wc –l # Useful in pipes
42
$
Read now
Unlock full access