Description of "2> & 1" in linuxshell

Source: Internet
Author: User
In linuxshell, & quot; 2 & gt; & amp; 1 & quot; meaning analysis problem: it takes 10 hours to compile the Android operating system code, to record possible problems during the compilation process, it is easy to debug. You need to output the compilation process to the file. In this way, you can also set automatic shutdown. Solution: Compile... in linux shell, the meaning of "2> & 1" is analyzed: It takes 10 hours to compile the Android operating system code, which may cause problems during the compilation process and facilitate debugging.
You need to output the compilation process to the file. In this way, you can also set automatic shutdown. Solution: Run make TARGET_PRODUCT = stalker OMAPES = 5.x-j4 2> & 1 | tee makelog. log is followed by: 2> & 1 | tee makelog. log to output logs to makelog. log file. Reference: www.2cto.com material 1: command> out. file 2> & 1 & command> out. file redirects command output to out. file, that is, the output content is not printed to the screen, but to the out. file. 2> & 1 redirects a standard error to the standard output. The standard output has been redirected to the out. file, which outputs a standard error to the out. file. The last & is to run the command in the background. Material 2: You can use ls 2> 1 to test it. The system does not report the error of No 2 files, but outputs an empty file 1. ls xxx 2> 1 to test, if the file xxx does not exist, the error is output to 1. if ls xxx 2> & 1 is tested, the file 1 is not generated, but the error is returned to the standard output; ls xxx> out.txt 2> & 1, which can be changed to ls xxx 1> out.txt 2> & 1; the redirection symbol> timeout is a error and the output is transmitted to out.txt. Author: lifeiaidajia
Related Article

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.