Pipe symbol "|" in Linux The role

Source: Internet
Author: User

Pipe symbol "|" in Linux The role

Command format: command a| command b, which is the correct output of command 1 as the operand of command B (apply someone else's picture)

1. For example: PS aux | grep "Test" looks for test in the results of PS aux.

2. For example: Find. -name "*.txt" | Xargs grep "Good"-n--color=auto the results of find as parameters into grep, which is the search for good keywords inside those files.

Note: In this example, Xargs splits the long list of files created by find into multiple substrings,

such as "" Find/path-type f-print0 | xargs-0 RM

Xargs splits the long list of files created by find into multiple substrings, and then calls the RM for each substring  Xargs may be mistaken, and if you need to handle special characters, you need to use the-0 parameter for processing. option Explanation
-0: When Sdtin contains special characters, think of it as a general character, like/' space ', etc.

Pipe symbol "|" in Linux The role

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.