The meaning of Linux1 & gt;/dev/null2 & gt; & amp; 1 may be frequently seen in shell: & gt;/dev/null2 & gt; & amp; the result of the 1 command can be defined in the form of % & gt; output/dev/null represents an empty device file & gt; represents the redirection location, for example: echo & quot; 123 & quot; & gt;/home/123.tx Linux 1>/dev/null 2> & 1 meaning shell may often see:> the result of the/dev/null 2> & 1 command can be defined in the form of %>. output/dev/null indicates an empty device file> indicates the redirection location, for example: echo "123">/home/123.txt 1 indicates stdout standard output. the default value is 1, therefore, ">/dev/null" is equivalent to "1>/dev/null" 2 indicating stderr standard errors & indicating equivalent meaning, 2> & 1, it indicates that the output redirection of 2 is equivalent to 1. 1>/dev/null indicates that the standard output is redirected to an empty device file, that is, no information is output to the terminal. to put it bluntly, no information is displayed. 2> & 1 Next, the standard error output redirection is equivalent to the standard output. because the standard output has been redirected to the empty device file, the standard error output is also redirected to the empty device file.
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.