Copied to clipboard

wc

The wc command is a command-line tool used to compute the byte count, word count, and line count of a given file.

Example

  • wc file.txt, count the number of lines, words, and characters in the file.txt file.
  • wc -l file.txt, count the number of lines in the file.txt file.
  • wc -w file.txt, count the number of words in the file.txt file.
  • wc -c file.txt, count the number of bytes in the file.txt file.
  • wc -m file.txt, count the number of characters in the file.txt file.