Summary of commands available for pipeline operations in Linux

Source: Internet
Author: User

A slightly more complex operation on a Linux Traditional Chinese medicine requires the use of a piping command "|" A combination of multiple commands, in the following form:

Command 1 |  Command 2 | Command 3 ...

Some commands in Linux can be used directly in pipeline commands, some of which are not, and for commands that cannot be used directly for pipelines, you need to use the Xargs command:

    • Find./-type F | Xargs md5sum >> Md5_rc1.txt
    • Find./-type f-print| Xargs md5sum >> Md5_rc1.txt
    • Find./-type f-print0| xargs-0 md5sum >> Md5_rc1.txt

Where the first and second results are similar, the third applies to files with spaces in the file name. The principle is: usually xargs for the partition file is the default: space, TAB, newline characters, etc.,-PRINT0 is a null partition file, xargs-0 is null to distinguish the file partition

And for the command that can be used directly to the pipeline, do not need to write directly to the Xargs can be written directly behind the pipe character can be judged, such as to determine whether the WC command can be used directly in the pipeline command

Ls-l | Wc-l

For common commands that can be used directly in pipelines, there are:

    • Cut
    • Grep
    • Sort
    • Uniq
    • Wc
    • Tee
    • Tr
    • Col
    • Join
    • Paste
    • Expand
    • Xargs

The specific usage and parameters of the command can be referenced

Http://www.cnblogs.com/lemonbar/archive/2014/08/24/3933390.html

Summary of commands available for pipeline operations 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.