WC commands in Linux

Source: Internet
Author: User

This command is used to count the number of characters and lines in a given file.
Command syntax: WC option file name
WC-L filename This statement is used to count the number of rows in a file named filename
WC-C filename This statement is used to count the number of bytes in a file named filename
WC-W filename This statement is used to count the number of words in a file named filename
In the analysis of the website log, wc-l filename is commonly used in the statistical method
For example, to count the number of visits to a link on my site, assuming that the link's Mark point is Aboutme, we can count the occurrences of the aboutme by looking at the log file.
Cat/var/apache/access.log | grep Aboutme | Wc-l

WC commands in Linux

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.