whatis dev-directory
/dev
Also known as: device files, device nodes
The directory of device files that represent hardware and kernel devices, such as /dev/sda, /dev/null, and /dev/tty.
What Is the /dev Directory in Linux?
Linux treats devices as files. Reading from /dev/sda reads raw bytes from a disk, /dev/null discards anything written to it, /dev/zero produces endless zero bytes, and /dev/urandom produces random ones.
Device nodes are created dynamically by the kernel and udev as hardware appears. Block devices (disks) and character devices (terminals, serial ports) are marked b and c in ls -l.
Example
ls -l /dev/null /dev/sda
# crw-rw-rw- ... /dev/null
# brw-rw---- ... /dev/sda Learn more about /dev
- The /dev Directory Explained: Device Files, null, zero and random Everything in /dev is a file that is not a file. Block versus character devices, why /dev/null and /dev/zero differ, what /dev/random actually blocks on now, and why the directory is rebuilt from nothing on every boot.
- udev Rules Explained: Making Devices Behave the Way You Want Device names are not stable, permissions default to root, and nothing happens automatically when you plug something in unless you tell it to. udev rules fix all three.