- Linux Shell Scripting Cookbook(Third Edition)
- Clif Flynt Sarath Lakshman Shantanu Tushar
- 98字
- 2021-07-09 19:46:37
Counting the number of lines, words, and characters in a file
Counting the number of lines, words, and characters in a text file is frequently useful. This book includes some tricky examples in other chapters where the counts are used to produce the required output. Counting LOC (Lines of Code) is a common application for developers. We may need to count a subset of files, for example, all source code files, but not object files. A combination of wc with other commands can perform that.
The wc utility counts lines, words, and characters. It stands for word count.