O'Reilly logo

SAMS Teach Yourself Unix in 10 Minutes by Robert Shimonski

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

The wc Command

In sum, the wc command counts words and provides you with a summary of what is found. Unix will report to you how many words are in a particular file. The wc stands for word count. When you want to see how many words are typed in a file, you simply need to execute the command and then the filename with its absolute or relative path. You will be shown the word count as well as the number of bytes, words, and lines in files.

The wc command is an excellent way to provide current statistics on a file you may want to work with. For example, if you wanted to issue the tail command on a file you think may be very large, you can use the wc command on a file to quickly see how many lines are in it. You can then use the tail command to jump ...

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