The path of Linux learning

Source: Internet
Author: User

Chapter III pipeline character, redirection and environment variables

  The pipe command , "|", is used to treat the standard output of the previous command as a standard input to the latter command,

Format: "Command a| command B"

  input and output redirection ,

Standard input, STDIN, file descriptor 0, default input from keyboard, 0 indicates output from other places or commands

Standard output, STDOUT, file descriptor 1, default output to screen, 1 indicates file

Error output, STDERR, file descriptor 2, default output to screen, 2 indicates file

The following is the case for output redirection:

Symbolic effect

Commands > Files redirect standard output to a file (clears the data from the original file)

Command 2> file redirects the error output to a file (clears the data from the original file)

Commands >> files redirect standard output to a file (appended to the original content)

The command 2>> file redirects the error output to a file (appended to the original content)

Command >> file 2$1 writes standard output and error output to a file (appended to the original content)

The following is the case for input redirection:

Command < file as standard input to the command

The command << delimiter reads the standard input into, until the meeting demarcation characters stops

Command < file 1> File 2 set file 1 as the standard input for the command and output the standard to file 2

The path of Linux learning

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.