Kolam Ayer MakersLinux Foundations

Devices And /dev

Core Idea

Linux exposes many devices through filesystem paths under /dev.

A device path is not an ordinary text file, even though commands can often open it like a file. It is an interface to the kernel or to hardware-like behavior.

Useful Examples

ls -l /dev/null /dev/zero /dev/random /dev/tty
printf 'discard me\n' > /dev/null

Why /dev/null Appears Early

find /etc -name '*.conf' 2>/dev/null

2> redirects stderr. /dev/null is the destination. This hides error output, so use it only after you understand what you are discarding.

Device File Listing

crw-rw-rw- 1 root root 1, 3 Aug 1 10:00 /dev/null

The leading c means character device. A leading b means block device. The numbers are device identifiers, not file size.

Common Confusions

Proof Check

Run ls -l /dev/null, redirect a harmless message into it, then explain why no output appears.

Docs Pointers