Using shell commands under Linux often uses shell output redirection like this:
1>/dev/null 2>&1
At the end of the shell command, we can redirect the output through the > symbol.
1. Standard input stdin file descriptor is 0, standard output stdout file descriptor is 1, standard error stderr file descriptor is 2
2./dev/null empty equipment files, equivalent to garbage cans
3. REDIRECT Symbol:>
Explain the above shell redirection command individually:
(1) > symbols represent output redirection
(2) > Previous figures:
0 represents standard input
1 represents the STDOUT standard output, the default value is 1, so "1>/dev/null" can be abbreviated as ">/dev/null"
2 represents stderr standard error output
(3) 2>&1 stderr standard error output redirect to stdout standard output
So, 1>/dev/null 2>&1 's explanation is
Redirects the stdout standard output to the empty device file/dev/null, while redirecting the STDERR standard error output to the STDOUT standard output redirection and outputting to the empty device file/dev/null.