The shell may often see: >/dev/null 2>&1
The result of the command can be defined as the output in the form of%>
/dev/null represents empty device files
> represents where to redirect, for example: echo "123" >/home/123.txt
1 indicates stdout standard output, the system default is 1, so ">/dev/null" is equivalent to "1>/dev/null"
2 indicates stderr standard error
& means equal to, 2>&1, indicating 2 output redirection equals 1
Then the statement of the title of this article:
1>/dev/null first indicates that the standard output is redirected to an empty device file, that is, not outputting any information to the terminal, which means no information is displayed.
2>&1 then, standard error output redirection is equivalent to standard output, because the standard output is redirected to an empty device file, so the normal error output is redirected to the empty device file.
This article turns from: http://dongwei.iteye.com/blog/322702