wc

command
v6.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Wc counts lines, words, runes, syntactically–invalid UTF codes.

Synopsis:

wc [OPTIONS...] [FILES]...

Description:

Wc counts lines, words, runes, syntactically–invalid UTF codes and bytes
in the named files, or in the standard input if no file is named. A word
is a maximal string of characters delimited by spaces, tabs or newlines.
The count of runes includes invalid codes. If the optional argument is
present, just the specified counts (lines, words, runes, broken UTF
codes or bytes) are selected by the letters l, w, r, b, or c. Otherwise,
lines, words and bytes (–lwc) are reported.

Options:

–l: count lines
–w: count words
–r: count runes
–b: count broken UTF codes
-c: count bytes

Bugs:

This wc differs from Plan 9's wc somewhat in word count (BSD's wc differs
even more significantly):

$ unicode 0x0-0x10ffff | 9 wc -w
2228221
$ unicode 0x0-0x10ffff | gowc -w
2228198
$ unicode 0x0-0x10ffff | bsdwc -w
2293628

This wc differs from Plan 9's wc significantly in bad rune count:

$ unicode 0x0-0x10ffff | gowc -b
6144
$ unicode 0x0-0x10ffff | 9 wc -b
1966080

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL