Monday, July 24, 2006

The Meaning of > /dev/null 2>&1

Sometimes, if we work under Linux world, we would find the "> /dev/null 2>&1" syntax. What it's mean?

  • The first part, "> /dev/null" means send standard output to the "bit bucket" or in other words, throw it away.
  • The second part, "2>&1" means "redirect standard error (2) to the same place as standard output (1)

That's all. Happy using Linux.

1 comment:

yo4rker said...

Hmm I love the idea behind this website, very unique.