count lines, words and files

Count the lines of a file or of a command's output, the words, and the files in a folder.

  • text
  • files

Steps

  1. wc -l file.txt

    the lines of a file

  2. wc -l *.csv

    the lines of each file, and the total

  3. wc -w file.txt

    the words

  4. grep -c . file.txt

    the lines that are not empty

  5. ls | wc -l

    the files and folders here

  6. find . -type f | wc -l

    every file under this folder

Commands used

  • wc
  • grep
  • find

Each has a page in lore: lore wc opens it.