/dev/null

What is /dev/null?

To begin, /dev/null is a special file called the null device in Unix systems. Colloquially it is also called the bit-bucket or the blackhole because it immediately discards anything written to it and only returns an end-of-file EOF when read.

Examples

Search for SUID binaries and discard error messages:

find / -perm -u=s -type f 2>/dev/null

Supress any output (both stdout and stderr) from the command:

<command> > /dev/null 2>&1

Reference

Last updated