"Linux" redirects and pipelines

Source: Internet
Author: User

REDIRECT Redirection

Each command has an input source and an output destination, and the default behavior is standard input and standard output. In most cases, the standard input is the keyboard, and the standard output is the screen. You can modify the inputs and outputs for individual operations, which is redirection . Redirection allows a command to be entered from a source file instead of a keyboard, or output to a place other than a display (such as a file).

Use < and > to define input and output sources. Use >> append to the end of the file.

Sort<terms>terms-alpha
This command sorts the entries in the terms file and then outputs them to the Terms-alpha file.

Bash output redirect File descriptor

0 Stdin
1 StdOut
2 StdErr

2>errfile

Output error messages for program Myprog to Errfile

Piping pipe

Pipeline | is an operator that combines input and output redirects, and the output of one command is immediately entered as another command

Sort<terms>terms-alpha | Mail Fred
After performing the previous action, mail the Terms-alpha file to Fred

"Linux" redirects and pipelines

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.