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