Standard input and output in Linux
Standard input 0 Get input from keyboard/proc/self/fd/0
Standard output 1 output to screen (i.e. console)/PROC/SELF/FD/1
Error output 2 output to screen (i.e. console)/PROC/SELF/FD/2
/dev/null represents an empty device file for Linux, all the content written to this file will be lost, commonly known as "black hole"
1, 2>/dev/null meaning is to export the error to "black hole"
2, >/dev/null 2>&1 default is 1, that is, the equivalent of 1>/dev/null 2>&1. This means redirecting the standard output to a "black hole" and redirecting the error output 2 to standard output 1, which means that the standard output and the error output are all in "black holes".
3, 2>&1 >/dev/null meaning is to redirect the error output 2 to the standard 1, that is, the screen, the standard output into the "black hole", that is, the standard output into the black hole, error output print to the screen
About the role of "&" here, we can understand that 2>/dev/null redirect to the file, then 2>&1, if you remove the & is the error output to the file 1, with the & is to indicate that 1 is the standard output.
Standard input and output in Linux