Pipelines and redirection

Source: Internet
Author: User
Redirection of input and output. standard Input Device: Corresponding Device File: devstdin, 0-device descriptor KEYBOARD standard output device: devstdout, 1MONITOR error output: devstderr, 2MONITOR redirection; input redirection: Indicates output redirection: overwrite, overwrite the original content, and append redirection e.

Redirection of input/output.

Standard input device:

Corresponding device file:

/Dev/stdin, 0-device descriptor KEYBOARD

Standard output device:

/Dev/stdout, 1 MONITOR

Error output:

/Dev/stderr, 2 MONITOR

Redirection;

Input redirection: <indicates

Output redirection:> overwrites the original content.

> Indicates append redirection.

Echo "------------------"> .......

Error output: 2>

(The output stream and the error output stream are different data streams)

Merge error standard output stream &> but not supported &>

To avoid mistakes:

 Set-C. Existing files cannot be overwritten.

, Disable overwrite redirection

You can use "> |" to force overwrite redirection.

Example:Ls/Var>/File2>/file2 correct information error messages are stored separately

Pipeline: "|"

COMMAND | COMMAND

FirstCommandAs the input of the next command,

Example: echo "123456" |Passwd-- Stdin rEdHat -- stdin

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.