User's manual. Section 1.

CNT(1): count lines, words, runes, and bytes


USAGE

DESCRIPTION

Cnt counts messages, lines, words, runes, and bytes in the given files. A word is defined as a series of non-control, non-separation-punctuation, and non-space runes at the start of a file or after a non-word rune. A rune is considered as separation-punctuation if it is punctuation and non-dash and non-connector. This definition is not compatible with the venerable wc UNIX command, but it is more accurate.

If no file is given, the program prints just the count(s). Otherwise, it prints the count(s) followed by the name of each file. All counters are printed by default, unless a flag says otherwise.

EXAMPLE

The same may be achieved running

Grep for struct or var declarations in go sources, filter only those that do not contain ix, and count the words in them:

The pipe selects each word and sends a message for each one, and then counting the messages produces the expected result.

SOURCE


User's manual. Section 1.