Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

*/5 * * * * /usr/local/bin/php somephpfile.php>> /dev/null 2>&1

What exactly does the dev/null 2 mean?


share|improve this question
up vote 2 down vote accepted

It's redirecting STDER (Standard Error) to go along with STDOUT (Standard Out). In short, both of them are redirected to /dev/null, meaning no output from the program is ever displayed.

share|improve this answer
So that you don't get an email if the command output something :) – Nicolas Viennot Jun 24 '10 at 23:54

2>&1 means "send stderr to stdout."

>>/dev/null means "append stdout to /dev/null," which is a way of hiding program output by sending it into /dev/null, whose only purpose in life is to act like a black hole for data. (Strictly speaking, for /dev/null, >>/dev/null is the same as >/dev/null.)

These rules are evaluated from right to left, so in combination they say, "hide everything output to stderr and stdout." A common mistake is to specify them in the reverse order, which will not hide the stderr output.

Also worth knowing: you can explicitly send both streams to /dev/null by saying 1>/dev/null 2>/dev/null or &>/dev/null rather than sending stderr to stdout and then sending stdout to /dev/null.

share|improve this answer
this was the best answer as it was explained the best. However I had already picked an answer :S – jini Jun 24 '10 at 22:25

It means redirect standard error and standard output to nothing (throw it away).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.