I/O Redirection Theory
number 1 = standard out (i.e. STDOUT) number 2 = standard error (i.e. STDERR) If a number isn’t explicitly given, then number 1 is assumed by bash.
The general form of this one is M>&-, where “M” is a file descriptor number. It closes output for whichever file descriptor is referenced, i.e. “M”.
The general form of this one is M>/dev/null, where “M” is a file descriptor number. It redirects the file descriptor “M”, to /dev/null.
The general form of this one is M>&N, where “M” & “N” are file descriptor numbers. It combines the output of file descriptors “M” and “N” into a single stream.
Abbreviation for 2>&1 |, which was added in Bash 4.
Abbreviation for >/dev/null 2>&1, which redirects the file descriptor 2 (STDERR) and the descriptor 1 (STDOUT) to /dev/null.
Abbreviation for 1>/dev/null, which redirects the file descriptor 1 (STDOUT) to /dev/null.