man.lsPlain-English help for Unix commands

wc Count lines, words and bytes

Counts the lines, words and bytes in files or in piped input. Use it to see how big a file is, or to count how many results another command produced.

Synopsis

wc [-clmw] [FILE]...
COMMAND | wc -l

Common options

Option or formWhat it does
-lCount lines (newline characters)
-wCount words, meaning runs of non-blank characters
-cCount bytes
-mCount characters. Differs from -c when text has multi-byte characters such as accented letters

Examples

Lines, words and bytes in a file
wc notes.txt
Count lines only
wc -l notes.txt
Count the lines in several files at once
wc -l notes.txt app.log data.csv
Count how many entries are in a folder
ls docs | wc -l
Count matching lines from another command
grep -i error app.log | wc -l
2
Count the files under a folder, including sub-folders
find docs -type f | wc -l
2

Notes

See also

Last reviewed 2026-10-07.