count¶
Count lines, words, and characters.
Synopsis¶
Description¶
Count lines, words, characters, and bytes in files. Similar to wc but with clearer flags.
Flags¶
| Flag | Short | Description | Default |
|---|---|---|---|
--lines |
-l |
Print the line count | false |
--words |
-w |
Print the word count | false |
--chars |
-c |
Print the character count | false |
--bytes |
-b |
Print the byte count | false |
--max-line |
-L |
Print the length of the longest line | false |
--total-only |
-t |
Print only the total (for multiple files) | false |
--no-filename |
-n |
Never print filenames | false |
Examples¶
Count lines, words, and characters (default):
Count only lines:
Count words:
Count bytes:
Find longest line:
Count from stdin:
Count multiple files:
Show only total for multiple files:
Sample Output¶
Default output (lines, words, chars):
Multiple files: