Description: This command counts the number of bytes, words, and lines in a given file. If the file name is not given, it is read from the standard input. The WC also gives the president count of all specified files. The word is the largest string separated by the space character area.
The command options have the following meanings:
-C Count bytes.
-L COUNT the number of rows.
-W counts the number of words.
These options can be used in combination.
The order and number of output columns are not affected by the order and number of options.
Always appear in the following order and at most one column per item.
Number of rows, words, bytes, filenames
If there is no file name in the command line, the file name does not appear in the output.
For example:
[[email protected] baidu91]# wc -l 2.txt
102 2.txt
[[email protected] baidu91]# more 2.txt|wc -l
102
[[email protected] baidu91]# wc -w 2.txt
1020 2.txt
[[email protected] baidu91]# wc -c 2.txt
18540 2.txt
[[email protected] baidu91]# wc 2.txt
102 1020 18540 2.txt
Linux statistics WC