Choose your dojo

Master every interface, one skill at a time

Count Results with wc

What This Does

Count lines, words, or characters in command output or files to turn output into insight.

Why It's Useful

Turn output into insight. Quickly know how many files match, how many lines a file has, or how many results a search returned.

How to Do It

  1. Use wc -l to count lines
  2. For example: ls | wc -l counts files in the current directory
  3. Or: grep "pattern" file.txt | wc -l counts matching lines
  4. Use wc -w for words, wc -c for characters

Try This Now

Run ls ~ | wc -l to see how many items are in your home directory. The number appears instantly.

Mental Hook: Turn output into insight.