Pipeline commands for Bash Shell

Source: Internet
Author: User

1.Cut: Command Select cut-d ' delimited character '-F fields
-D: followed by delimited characters, used with-f
-F: Cutting a piece of information into several segments according to the delimited character of-D
-C: Remove a fixed character range in units of characters
Eg:echo $PATH | Cut-d ': '-F 5
To ";" as a separator, take the fifth paragraph of characters
2.grep: The Cut command above takes a section out of a line of information, and grep parses a piece of information and takes out the line grep [-ACINV] [–color=auto] ' Find string ' file
-A: Find data with binary files as text files
-V: Reverse selection, which shows the line without the ' Find string ' content
–color =auto: You can add a color display to the Found keyword section
3.Sort: Sort command sort [-fbmnrtuk] [file or stdin]
-F: Ignore case-B: Ignore front whitespace-M: Sort by month
-N: Sort by number-r: Reverse Sort
4.Uniq: sequencing, only one display of duplicate data is listed Uniq [-ic]
-I: Ignore case-C: Count
5.WC: The number of rows, words, and characters in the contents of the display WC [-LWM]
-L: List only travel-W: List only how many characters-M: list only
6.Tee: Bidirectional redirect Tee [-A] file
-A: Add data to file in a cumulative way
Eg:ls-l Home | Tee ~/homefile | More
The data of LS is saved to ~/homefile, and the output information is also available on the screen.
7.TR: Delete or replace text in a message tr [-ds] SET1 ...
-D: Delete message SET1 this string
-S: replace repeating characters
Eg1:last | TR ' [A-z] ' [A-z] ' converts lowercase characters into uppercase letters
eg2:cat/etc/passwd | Tr-d ': ' Delete colon
8.ColConvert tab key to space bar Col [-X]
9.Join: Add the same row of data in the two file join [-ti12] file1 file2
-T: Data is separated by whitespace by default
10.Paste: Put two lines together, and [tab] key to separate paste [-d] file1 file2
Eg:paste/etc/passwd/etc/shadow paste the two file with the same line
11.Expand: Convert [tab] key to SPACEBAR expand [-T] File
12.Split: Cut character split [-BL] File PREFIX
-B: The size of the file to be cut in the rear, can be connected to the unit
-L: Cut by number of rows
PREFIX: Represents a leader character that can be used as a leading file for cutting files
Eg:split-b 200k/etc/termcap termcap
13.Xargs: Parameter substitution xargs [ -0EPN] Command

Pipeline commands for Bash Shell

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.