Linux commands: WC

Source: Internet
Author: User

Introduction to the WC command:

The WC command is used to count the number of lines of text, the number of words, and the number of bytes.

1. command format:

WC [OPTION] ... [FILE] ...
WC [OPTION] ...--files0-from=f


2. Command function:

The WC command is used to count the number of lines of text, the number of words, and the number of bytes.

3. Command parameters:

-L: Show only lines of text

-W: Displays only the number of words

-C: Show only the number of bytes

-M: Displays only the number of characters

-L: Indicates how many characters the longest row contains

4. Command instance:

[Email protected] test]# wc-l/etc/passwd

29/etc/passwd

[Email protected] test]# wc-l/etc/passwd

89/etc/passwd

[Email protected] test]# wc-c/etc/passwd

1381/etc/passwd

[Email protected] test]# wc-w/etc/passwd

50/etc/passwd

2. TR character processing command: Used to convert or delete characters

tr [OPTION]...SET1 [Set2] set represents a set of

Tr ' A-Z ' A-Z ' </etc/passwd all lowercase letters in the passwd file into uppercase

-D: Delete all characters that appear in the character set

[[email protected] test]# tr-d ' AB '

Helloabcd

Hellocd


This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1859412

Linux commands: WC

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.