WC prints line breaks, word and byte counts, and supports multiple file printing, command format:
WC [OPTION] ... [FILE] ...
Or
WC [OPTION] ...--files0-from=f
Common ways:
View Error.log Log Total rows
Wc-l Error.log
View the total number of Error.log log bytes
Wc-c Error.log
View the number of file lines for the Error.* class in the log directory
Wc-l log/error.*
Parameter list:
-C,--bytes
Description: Total bytes of printed files
-M,--chars
Description: The total number of characters in the printed file
-L,--lines
Description: Total number of rows in the printed file
--files0-from=f read input from the files specified by
nul-terminated names in file F;
If F Is-then read names from standard input
Description: Print batch To specify some files, bytes, lines, characters, and other information.
When F is a file name, the specified file name is read (the contents of the file being read should be the specified list of file names, and the ^@ special symbol is appended to the end of each file name, Note: This symbol is not ^ with @ but press CTRL + V and then enter 10 and then press the other key to see the type ^@ Blue symbol). Such as:
File TEST.WC content:
sh.log^ @test. sh^@
Command:
WC--FILES0-FROM=TEST.WC
Results:
[[email protected] ~]# WC--files0-from=test.txt 460275 1332379 40275303 sh.log 9 338 TEST.SHWC:: N o such file or directory 460284 1332404 40275641 Total
When F is-it means receiving standard input reads, general use | Pipe input to WC, e.g.:
Find. -name ' *.log '-print0 |WC--files0-from=-
You can also use the command tearful related instructions:
Info WC
-L,--max-line-length
Description: The maximum number of lines in a file to print
-W,--words
Description: Print the number of words in a file
--help
Description: Display Help information
--version
Description: Print the current command version information
This article is from the "gangbusters" blog, make sure to keep this source http://php2012web.blog.51cto.com/5585213/1672524
Linux WC print line break, Word and byte count