[prev] 9 [next]

Devices on Unix/Linux

Unix treats devices uniformly as byte-streams (like files).

Devices can be accessed via the file system under /dev, e.g.

  • /dev/diskN ... (part of) a hard drive
  • /dev/ttyN ... a terminal device
  • /dev/ptyN ... a pseudo-terminal device
Other interesting "devices" in /dev
  • /dev/mem ... the physical memory (mostly protected)
  • /dev/null ... data sink or empty source
  • /dev/random ... stream of pseudo-random numbers