Scroll to navigation

WC(1) General Commands Manual WC(1)

NAME

wc - Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified.

SYNOPSIS

wc [-c|--bytes] [-m|--chars] [--files0-from] [-l|--lines] [-L|--max-line-length] [--total] [-w|--words] [-h|--help] [-V|--version] [files]

DESCRIPTION

Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified.

OPTIONS

print the byte counts
print the character counts
read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input
print the newline counts
print the length of the longest line
when to print a line with total counts; WHEN can be: auto, always, only, never
print the word counts
Print help
Print version
[files]

VERSION

v(uutils coreutils) 0.9.0

EXAMPLES

Count all lines in a file:

wc [-l|--lines] path/to/file

Count all words in a file:

wc [-w|--words] path/to/file

Count all bytes in a file:

wc [-c|--bytes] path/to/file

Count all characters in a file (taking multi-byte characters into account):

wc [-m|--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 [-L|--max-line-length] path/to/file

The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.

2026-06-04