What does wc do?

count lines, words and bytes.

▸ Explain your own wc command →

wc examples, explained

$ wc -l file.txt

  • wccount lines, words and bytes
  • -lcount lines
  • file.txtan argument passed to the command

$ wc -w -c file.txt

  • wccount lines, words and bytes
  • -wcount words
  • -ccount bytes
  • file.txtan argument passed to the command

wc flags & options

-lcount lines
-wcount words
-ccount bytes
-mcount characters

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.