Kolam Ayer MakersLinux Foundations

/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

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