WC(1)

✨ WC(1) β€” the count-everything bestie of the manual pages ✨

okay so, <rainbow>wc</rainbow> β€” short for word count, but honestly? she does so much more than words. Manual section 1, General Commands Manual, and she's literally the moment. πŸ’…


🌸 NAME 🌸

wc β€” print newline, word, and byte counts for each FILE, plus a total line if you hand her more than one FILE. (Yes bestie, she keeps score. Obsessed. πŸŽ€)


πŸ¦‹ SYNOPSIS πŸ¦‹

wc [OPTION]... [FILE]...

πŸ’– DESCRIPTION πŸ’–

Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified. That's it, that's the whole vibe. Give her files, she gives you numbers. Give her a whole bunch of files and she'll add up a total at the end like the responsible main character she is. πŸ‘‘


✨ OPTIONS ✨

  • -c, --bytes β€” print the byte counts 🫢
  • -m, --chars β€” print the character counts
  • --files0-from F β€” read input from the files specified by NUL-terminated names in file F. if F is - then read the names from standard input 🌈
  • -l, --lines β€” print the newline counts
  • -L, --max-line-length β€” print the length of the longest line
  • --total WHEN β€” when to print a line with total counts. WHEN can be: auto, always, only, never
  • -w, --words β€” print the word counts πŸ“
  • -h, --help β€” print help
  • -V, --version β€” print version
  • [files] β€” the files, bestie

πŸ’œ VERSION πŸ’œ

v(uutils coreutils) 0.12.0


πŸ”₯ EXAMPLES πŸ”₯

Count all lines in a file:

wc [-l|--lines] path/to/file

Count all words in a file:

wc [-w|--words] path/to/file

Count all bytes in a file:

wc [-c|--bytes] path/to/file

Count all characters in a file (taking multi-byte characters into account):

wc [-m|--chars] path/to/file

Count all lines, words, and bytes from stdin:

find . | wc

Count the length of the longest line in number of characters:

wc [-L|--max-line-length] path/to/file
These examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. heads up though: as uutils is a work in progress, some of these examples might fail. 😭 not a vibe, but we're being honest about it.

and that's the whole page, bestie πŸ’– this one's from uutils coreutils, version 0.12.0, dated 2026-09-25 β€” go count something and slay. πŸ§šβ­πŸ‘‘

πŸ“¦ where this page comes from