-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

The Ultimate Linux Shell Scripting Guide
By :

This easy-to-use utility gives you a quick way to count the number of lines, words, and/or bytes in a text file. So, if you’re typing a document that can only contain a certain number of words, you don’t have to sit there and manually try to count the words as you scroll the document up your screen. Just use wc
, instead.
The default output for wc
shows you the number of lines, followed by the number of words, and then by the number of bytes. Finally, it shows the name of the input file. Here’s how that looks:
[donnie@fedora ~]$ wc actorfile_1.txt
5 10 67 actorfile_1.txt
[donnie@fedora ~]$
So, the actorfile_1.txt
file contains five lines, ten words, and 67 bytes.
If you specify more than one file, wc
will tell give you information for each individual file, and the total for all of the files, which looks like this:
[donnie@fedora ~]$ wc actorfile_1.txt actorfile_2.txt macgruder.txt
5 10 67 actorfile_1.txt
5 10 77 actorfile_2...