First both stdout(1) and stderr(2) point to your terminal.
You then redirect stderr to whatever your stdout points to. (Which is the terminal.)
Afterwards you redirect stdout to /dev/null
. But stderr still points to the terminal.
You can do it the other way around >/dev/null 2>&1
: This way you first redirect stdout to /dev/null
and then stderr to the same.
Bash provides the shorthand &>/dev/null
for this.