Posted by: nevil | November 20, 2007

What does >/dev/null 2>&1 mean ?

In linux you would use this command to make any output by that command to be silent.

some_program > /dev/null 2>&1

The first part, “> /dev/null” means send standard output to the ‘bit bucket” or in other words, throw it away. It makes sense to use the > /dev/null so that the output goes to null and disappears

The second part, “2>&1″ means “redirect standard error (2) to the same place as standard outout (1.)

Leave a response

Your response:

Categories