What is the Unix/Linux “bit bucket”?

Unix/Linux FAQ: What is the “bit bucket”?

The bit bucket is a way of referring /dev/null. Sending output to the /dev/null device file is like sending output directly to the trash. That’s why you see code like this a lot of times:

aCommand 2> /dev/null

That’s a way of saying, “Run the command aCommand and send it’s error output to the bit bucket.” In use like this, “error output” refers to STDERR, and redirecting STDERR to the bit bucket is the same as throwing it into the trash (or throwing it into a black hole, if you prefer).

Another way you can demonstrate this is by sending STDOUT to the bit bucket. In this next example, I send the output from the ls command to the bit bucket:

ls -l > /dev/null

If you run that command, you won’t see any output because the standard output — STDOUT — is redirected to /dev/null. There’s no practical reason for doing this in the real world; I just wanted to demonstrate that you can redirect both STDOUT and STDERR to the bit bucket, if you ever need to.

For more information, here’s a short tutorial on How to redirect Unix STDOUT and STDERR to the same location.