The bit bucket
/dev/null is a special file that throws away everything written to it and returns 0 bytes when read. It is the canonical way to silence noise in Unix.
Common uses
cmd 2>/dev/null— kill error spam.cmd >/dev/null 2>&1— kill all output.cmd </dev/null— feed an empty stdin (useful for background jobs that read).: > fileorcat /dev/null > file— truncate a file to zero.
The truthy version: /dev/zero
/dev/zero reads as an infinite stream of null bytes. dd if=/dev/zero of=blob bs=1M count=10 creates a 10 MB file of zeros — useful for filesystem tests, swap files, or generating test data. Sibling: /dev/random (cryptographic randomness, slow) and /dev/urandom (also random, fast, fine for almost everything).
Don't accidentally redirect input
cmd > /dev/null hides output. cmd < /dev/null feeds empty stdin. Mix them up and your script silently does nothing because you fed it an empty input stream.