Linux redirection standard input and output, standard error

Source: Internet
Author: User

The standard input is the file descriptor 0. It is the input to the command, the default is the keyboard, or it can be the output of a file or other command.
The standard output is the file descriptor 1. It is the output of the command, the default is the screen, or it can be a file.
The standard error is file descriptor 2. This is the output of the command error, the default is the screen, also can be a file.

Common program errors and status outputs are standard errors.

REDIRECT Standard output:

LS >ls.out

REDIRECT Standard input:

The sort < name.txt//Sort command is given in the form of a redirect, but it can also be used to direct the corresponding

REDIRECT Standard error:

grep color File 2> result.out

Standard output and error output are integrated:

grep color File > Result.out 2>&1

Qtalk Background command:

Setsid/home/arsenal/software/qtalk/run.sh>~/qtalk.out 2>&1

Linux redirection standard input and output, standard error

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.