O'Reilly logo

A Practical Guide to Red Hat® Linux® 8 by Mark G. Sobell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

wc

Displays the number of lines, words, and bytes in a file

wc [options] [file-list]

The wc utility displays the number of lines, words, and bytes contained in one or more files. When you specify more than one file on the command line, wc displays totals for each file and totals for the group of files. The wc utility takes its input from files you specify on the command line or from standard input.

Arguments

The file-list contains the pathnames of one or more files that wc analyzes.

Options

--bytes

-c Displays only the number of bytes in the file.

--lines

-l (“ell”) Displays only the number of lines (that is, NEWLINE characters) in the file.

--words

-w Displays only the number of words in the file.

Notes

A word is a sequence of characters ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required