|
|
The wc(C) command counts the number of lines, words, and characters in a file, using the options -l, -w, or -c respectively. For example, to print the number of characters and lines in a file called myfile, execute the following command:
$ wc -cl myfile
32675 684 myfile
The order in which you specify the options determines the order of
the output.
You can also give wc a list of files to count:
$ wc chap1 chap3
105 676 3844 chap1
675 3869 24269 chap3
780 4545 28113 total
The total line gives sums for the lines, words and
characters in the two files, chap1 and chap2.