Ever been confused seeing those funny greater than signs being used on a unix system ? Let me try to explain those weird commands.
The greater than sign means the output is being redirected somewhere else. Let’s have a look at an example to be more clear.
In this example, something is being redirected to /dev/null and something else is being redirected to &1.
Before moving further, lets discuss about STDIN,STDOUT, and STDERR. These are the 3 sources of input and output for any particular program. STDIN means Standard Input, STDOUT means Standard Output, and STDERR means Standard Error. They are numerically denoted as 0, 1 and 2 respectively. If you do not name or number any of them, that particularly means you are talking about STDOUT.
Getting back to the example,
That means, using > /dev/null 2>&1 can be used to make any program work quietly with no STDOUT and/or STDERR.
This can also be done alternatively as
It’s still the same.
