This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the unix category.
Last Updated: 2024-11-21
Device nodes on Unix-like systems do not necessarily have to correspond to physical devices. Nodes that lack this correspondence form the group of pseudo-devices. They provide various functions handled by the operating system. Some of the most commonly used (character-based) pseudo-devices include:
/dev/null
– accepts and discards all input written to it; provides an
end-of-file indication when read from./dev/zero
– accepts and discards all input written to it; produces a
continuous stream of null characters (zero-value bytes) as output when read
from./dev/full
– produces a continuous stream of null characters (zero-value
bytes) as output when read from, and generates an ENOSPC ("disk full") error
when attempting to write to it./dev/random
– produces bytes generated by the kernel's cryptographically
secure pseudorandom number generator. Its exact behavior varies by
implementation, and sometimes variants such as /dev/urandom or /dev/arandom
are also provided.