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 ...

Get A Practical Guide to Red Hat® Linux® 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.