$ wc
Print newline, word, and byte counts
DOCUMENTEDSearch & textUbuntu 24.04 LTS baseline
Synopsis
wc [OPTION]... [FILE]...
What it does
- With no options, `wc` reports newline, word, and byte counts.
- The interpretation of characters versus bytes depends on the selected option.
Examples
Count lines
wc -l file.txtCount words
wc -w file.txtCount bytes
wc -c file.binImportant details
These examples are intentionally conservative. Command behavior can still depend on filesystem state, permissions, locale, shell, installed package version, and other system configuration.
For exact option semantics, the linked authoritative documentation is the source of truth.