, everything is a file
, including physical and logical device
s, like disk drives, terminals,
printers, tape drives, and in a strange way, even memory.
/dev/null is a character device with no physical manifestation. It is humorously called the write only backup device by the bofh community. On the surface, this may seem useless -- why bother
writing to a device when you can never read the data back? The reason for writing to it
is exactly that -- you never want the data back.
The /dev/null pseudo device is used specifically to throw away data you don't want.
It is used by either redirecting output to the device, or by mentioning the
device where the application expects an output filename. Sometimes it is easier to just tell the app to write its log file to /dev/null than to
provide an option in the app to turn logging off. /dev/null is the unix oubliette, the perfect place for garbage, flames, stupid comments from lusers, etc.
In Microsoft Windows/msdos, the equivalent of /dev/null is null: or nul