WC in a Linux system (Word Count) the function of the command is to count the number of bytes, words, and lines in the specified file, and to display the output of the statistic results.
1. command format:
WC [Options] File ...
2. Command function:
Counts the number of bytes, words, and lines in the specified file, and displays the output of the statistics. This command counts the number of bytes, word count, and number of lines in the specified file. If the file name is not given, it is read from the standard input. The WC also gives the president count of the files specified.
3. Command parameters:
-C Count bytes. -C count characters, same as-M
-L counts the number of rows.
-M counts the number of characters. This flag cannot be used with the-C flag.
-W count words. A word is defined as a string separated by a blank, a jump, or a newline character.
-L Prints the length of the longest line.
-HELP Display Help information
--version displaying version information
4. usage Examples:
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[[email protected] ~]# cat test-wc this is a test
for command wc A B C D E F [[email protected] ~]# wc test-wc
4 13 45 test-wc [[email protected] ~]# wc -l test-wc 4 test-wc [[email protected] ~]# wc -w test-wc 13 test-wc [[email protected] ~]# wc -c test-wc 45 test-wc [[email protected] ~]# wc -L test-wc 30 test-wc [[email protected] ~]# wc -m test-wc 45 test-wc
|