Use the wc command to count words, lines, bytes and characters on the command line and get fast file statistics. 16.11.2025 | reading time: 2 min The wc command is the simplest way to get instant counts for lines, words and bytes of a file; it helps when he inspects logs, reports or script output and needs quick metrics. Hands-on example Create a tiny test file and run wc to see real output:\n```bash\nprintf "Errors found\nTotal: 42 widgets\nDone\n" > report.txt\nwc -l report.txt\n# => 3 report.txt\nwc -w report.txt\n# => 6 report.txt\nwc -c report.txt\n# => 36 report.txt\nwc report.txt\n# => 3 6 36 report.txt\ncat report.txt | wc -w\n# => 6\n``` When wc becomes more powerful Use the switches -l, -w and -c to get only lines, words or bytes respectively, and -m to count characters when multibyte encodings matter; combine files like `wc *.log` to get per-file counts and a total, or pipe input (for example `grep error file | wc -l`) to count matches quickly. Practical caveats and tips Remember that wc counts words as whitespace-separated tokens, so punctuation stays attached to words and locale and encoding affect -m versus -c; prefer -m for character counts in UTF-8 and use wc -L to find the longest line on GNU systems. Where wc fits in a toolkit Use wc as a fast, reliable counter and pair it with grep, awk or find/xargs for filtered, aggregated or recursive counts across many files; for precise per-field counts prefer awk and for pattern-based line counts prefer grep -c. Wrap-up and next steps Start practicing with small files and then apply wc in pipes and scripts to automate reporting; to deepen command-line skills consider preparing for certifications such as CompTIA Linux+ or LPIC-1 with intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. utilities scripting filesystem