CentOS statistics command wc

Source: Internet
Author: User

CentOS statistics command wc

Wc is a linux statistical command that collects statistics on the number of bytes, number of words, and number of rows in a specified file, and displays the statistical results.

Reprinted from: One linux Command every day (40): wc command

Command parameters:
C. count the number of bytes. -L number of statistics rows. -M: The number of characters. This flag cannot be used with the-c flag. -W counts the number of words. A character is defined as a string separated by blank, Skip, or line breaks. -L print the maximum length of a row. -Help: Display help information -- version: display version information
Instance
$ Wc access. log 217918 5997074 60703635 access. log $ wc-l access. log # the number of rows is 217993 access. log $ wc-c access. log #60755127 access. log $ wc-m access. log # access with 60755127 characters. log $ wc-w access. log # Word 6002544 access. log
Cat and wc

If you directly use the wc statistical file, the output result will contain a file name. Sometimes we don't need it, so we can use it together with cat for a long time.

$ Cat access. log | wc 218241 6008005 60807352 $ cat access. log | wc-l 218241

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.