wc

Count lines, words, and bytes. More information: <https://www.gnu.org/software/coreutils/wc>.

Install

All systems
curl cmd.cat/wc.sh
Debian Debian
apt-get install coreutils
Ubuntu
apt-get install coreutils
Alpine
apk add coreutils
Arch Arch Linux
pacman -S coreutils
image/svg+xml Kali Linux
apt-get install coreutils
CentOS
yum install coreutils
Fedora
dnf install coreutils
Windows (WSL2)
sudo apt-get update sudo apt-get install coreutils
OS X
brew install coreutils
Raspbian
apt-get install coreutils
Docker
docker run cmd.cat/wc wc powered by Commando

Count lines, words, and bytes. More information: <https://www.gnu.org/software/coreutils/wc>.

  • Count all lines in a file:
    wc --lines path/to/file
  • Count all words in a file:
    wc --words path/to/file
  • Count all bytes in a file:
    wc --bytes path/to/file
  • Count all characters in a file (taking multi-byte characters into account):
    wc --chars path/to/file
  • Count all lines, words and bytes from `stdin`:
    find . | wc
  • Count the length of the longest line in number of characters:
    wc --max-line-length path/to/file

© tl;dr; authors and contributors