This may be used in the shell, including DOS.
Null is something called a null bucket, and the benefit of redirecting the output to it is that the file size is not constantly increasing due to too much content in the output. In fact, you think that null is nothing, that is, the output of the command is discarded.
1 indicates standard output, 2 indicates standard error output, 2>&1 indicates the standard error output is redirected to standard output, so that the normal output and error output of the program or command can be output in standard output.
In general, standard output and standard error output are screens, so why use it? The reason is the redirection of the standard output. Your example is redirected to null if you redirect to a file, for example:
Dir > OUT.txt
Indicates that standard output is redirected to the OUT.txt file. If the dir command fails, the error message is not output to the OUT.txt file, and the error message is still output to the screen-standard error output. To redirect the correct information and the wrong information to the OUT.txt file, you need to redirect the standard error output of the error message to standard output. The command is as follows:
dir > OUT.txt 2>&1
Redirecting to NULL is a reason.
dir > Null 2>&1
>/dev/null 2>&1 The meaning of this sentence and the meaning of its use