Devices · Lesson 1 of 7
/dev directory
0%
0 / 4 checkpoints answered
Linux exposes many kernel device interfaces through special filesystem objects called device nodes. They normally appear under /dev, alongside useful symbolic links and communication endpoints. Opening a device node connects an application to a kernel driver rather than to bytes stored in an ordinary file.
Exploring /dev
List the directory without dereferencing or reading devices:
$ ls -l /dev
Entries can represent physical storage, terminals, input interfaces, logical devices, or kernel-provided pseudo-devices. Not every hardware component needs its own user-visible node, and one device can be represented through several links or interfaces.
The first character of a long listing identifies the filesystem object type. Character and block device nodes appear as c and b; later lessons examine these types and their major and minor numbers.
CheckWhat happens when a program opens a device node under /dev?
press 1/2/3 to answer · → next lesson
Pseudo-Devices
Some nodes provide kernel services without corresponding to physical hardware. /dev/null accepts and discards written data:
$ command > /dev/null
Other familiar examples include /dev/zero, which produces zero bytes, and /dev/urandom, which provides random bytes through the kernel random subsystem. Each has specific semantics; do not infer behavior only from its filename.
CheckWhat does /dev/null do with data written to it?
press 1/2/3 to answer · → next lesson
Dynamic Device Management
On modern Linux systems, the kernel-backed devtmpfs can populate basic device nodes as devices appear. A user-space device manager such as udev processes events, applies permissions and ownership, and creates useful symbolic links or policy-driven names. Exact responsibilities vary by system.
Stable links such as entries under /dev/disk/by-id/ or /dev/disk/by-uuid/ can be safer in configuration than detection-order names such as /dev/sda, which can change when hardware topology or discovery order changes.
CheckWhy might an administrator prefer /dev/disk/by-id/... over /dev/sda in configuration?
press 1/2/3 to answer · → next lesson
Interacting Safely
Standard tools can open device nodes, but that does not make arbitrary reads and writes safe. Reading can expose sensitive input or storage; writing to a disk, terminal, or firmware interface can corrupt data or disrupt users. Device-node permissions, groups, ACLs, capabilities, and service mediation restrict access for this reason.
Use read-only discovery tools first, confirm the exact node and device identity, and follow device-specific documentation. Never experiment by redirecting data into an unfamiliar /dev entry on a system you care about.
CheckWhy should you avoid writing arbitrary data to an unfamiliar device node?
press 1/2/3 to answer · → next lesson
Use Explore Hardware Devices in Linux for read-only inspection in a controlled environment.
Summary
You can now describe /dev as a set of live kernel-facing interfaces.
- Distinguish device nodes from ordinary files.
- Recognize pseudo-devices such as
/dev/null. - Relate dynamic nodes and persistent links to device management.
- Treat direct device access as interface-specific and potentially destructive.
Practice
In the practice terminal, run: ls -l /dev It should print a long list of device entries, each starting with a type letter like c, b, or l.
ls -l /dev lists device nodes without opening them.
Lesson complete
You finished /dev directory. Nice work — keep the momentum going.