Basic Text processing wc statistics on the number of lines, words, and characters

Source: Internet
Author: User
The function of the basic text processing wc command to count the number of lines, characters, and characters in a specified file is to count the number of characters, words, and lines in a specified file, and display the statistical results. Www.2cto.com syntax: wc [option] File & hellip; Description: This command counts the number of characters, words ,... the function of the basic text processing wc command to count the number of lines, characters, and characters in a specified file is to count the number of characters, words, and lines in a specified file, and display the statistical results. Www.2cto.com syntax: wc [option] file... Note: this command counts the number of characters, characters, and lines in a given file. If no file name is provided
Quasi-input reading. Wc also provides the president count for all specified files. Is the largest string separated by space characters. The meaning of each option of this command is as follows:-c counts the number of characters. -L number of statistics rows. -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. It is always displayed in the following order and each item has at most one column. If the command line does not contain a file name, the output does not contain a file name. For example, $ wc-lcw file1 file2 4 33 file1 7 52 file2 11 11 85 total omit any option-lcw. the wc command execution result is the same as above. 1. used to count the number of files in the current directory # ls-l | wc-l 2. used to count files ending with sh # wc. /*. sh 12 33 191. /case. sh 7 9 46. /expresstest. sh 5 14 75. /. sh 11 46 263. /testif. sh 35 102 575 total 3. find the number of files ending with sh # find. -name '*. sh' | wc-l44, find the number of rows in the/etc/passwd file that contain the bash string # grep bash/etc/passwd | wc-l4
Related Article

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.