The function of the WC command is to count the number of bytes, words, and rows in the specified file and display the results to the output.
Syntax: WC [options] File ...
Description: This command counts the number of bytes, words, and lines in a given file. If no file name is given, read from standard input. The WC gives also the president count of all specified documents at the same time. A word is the largest string that is separated by a space character area.
The options for this command have the following meanings:
-C Statistics the number of bytes.
-L statistic line count.
-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 each item is at most one column.
Number of lines, words, bytes, file names
If there is no file name on the command line, the file name does not appear in the output.
For example:
$ WC-LCW file1 file2
4 file1
7 File2
Total
Omit option-LCW,WC command has the same execution result as above
Example:
The WC command is used to compute the number of lines, words, and characters in a file or in a specified number of files. Such as:
WC filename
The first column shows the number of rows, the second column shows the number of words, and the third column shows the number of characters.
WC has four parameters to choose from, namely L,c,m,w
Wc-l FileName Report Line number
wc-c FileName Report byte number
WC-M FileName Report character number
WC-W FileName Report Word number
The command you see today is: Ls-l|wc-l to count the number of files in the current directory