Counting the number of lines, words, and characters from a text or file are very useful for text manipulations. In several cases, count of words or characters are used in indirect ways to perform some hacks to produce required output patterns and results. This book includes some of such tricky examples in other chapters. Counting
LOC (Lines of Code) is an important application for developers. We may need to count special types of files excluding unnecessary files. A combination of
wc with other commands help to perform that.
wc is the utility used for counting. It stands for Word Count (wc). Let's see how to use
wc to count lines, words, and characters.