/dev/null
Core Idea
/dev/null is a special device path that discards anything written to it.
It is not a command. Commands use it as an I/O destination.
Why It Exists
Sometimes you deliberately do not want one stream. /dev/null is the standard Unix sink for that unwanted output.
find /etc -name '*.conf' 2>/dev/null
That command keeps normal output and discards permission errors on stderr.
Behavior
- Writing to
/dev/nullsucceeds and discards bytes. - Reading from
/dev/nullreturns end of file immediately. - It appears under
/devbecause it is a device, not an ordinary file.
Watch Out
Do not hide errors until you understand them. Redirect to a file first when errors might be useful evidence.
Proof Check
Run this and explain why nothing appears:
printf 'discard me\n' >/dev/null
Docs Pointers
- Run
man null. - Read devices, I/O, file descriptors, and stream redirection.

Linux Foundations