/dev/null 2>&1 explained to humans

If you ever made a cron job, or a script that executes something and produces an output in the console, you are probably familiar with the fact that piping it to /dev/null 2>&1 can silence it :)

But do you really know what this command is doing, or what the 1 and 2 mean? I found a damn good article on a blog just about that: explain pipes, standard in, standard out and errors to human beings.

It’s on http://www.xaprb.com/blog/2006/06/06/what-does-devnull-21-mean, a must read!

Leave a Reply