wc
The program reads either standard input or a list of files and generates one or more of the following statistics: newline count, word count, and byte count. If a list of files is provided, both individual file and total statistics follow.[1]
- GNU Coreutils [EN] @ Fedora Package
- GNU Coreutils [EN] @ Homebrew Formula
Documentation
- wc [EN] @ GNU Coreutils Manual
- man 1 'wc' [EN]
Syntax
wc [PARAMETER ...] [FILE ...]
Parameters
- -l, --lines
- Print the newline counts.
- -L, --max-line-length
- Print the length of the longest line.
- -w, --words
- Print the word counts.
Examples
- Shows the longest line of a file[2]
tr '\t' ' ' <'test.txt' | wc --max-line-length