LinuxI Β· FoundationsKernel filesystems
/proc, /sys, /dev, /run β the kernel-exposed filesystems
What you'll learn
- Read process and kernel information from /proc
- Read device, driver, and subsystem information from /sys
- Locate device files in /dev and understand udev
- Recognise /run as the modern location for transient runtime state
Prerequisites
None β start here.
Verified against Ubuntu 24.04 LTS Β· Debian 12 (Bookworm) Β· RHEL 9.x Β· Rocky Linux 9.x Β· AlmaLinux 9.x Β· Linux kernel 6.1 LTS / 6.6 LTS Β· systemd 255+ Β· OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) Β· nftables 1.0.x Β· chrony 4.x Β· Pacemaker 2.1.x Β· Corosync 3.1.x Β· 2026-08-09
Linux exposes most of its runtime state as files. The four
pseudo-filesystems introduced here β /proc, /sys, /dev, /run β
are how sysadmins and tools observe and influence the kernel without
writing ioctl-based code.
/proc β process and kernel information
/proc is implemented by the kernel directly. There is no on-disk storage. When you read a file under /proc, the kernel synthesises the contents on demand.
Process directories
Every running process has a directory named after its PID:
/proc/1/ β PID 1 (init)
βββ cmdline β null-separated argv
βββ comm β executable basename
βββ cwd -> / β current working directory (a symlink)
βββ environ β environment variables
βββ exe -> /usr/lib/systemd/systemd
βββ fd/ β open file descriptors
βββ maps β memory mappings
βββ status β process state, VmRSS, threads
βββ task/ β threads (one subdir per TID)
βββ limits β ulimit values
$ cat /proc/$$/status | head -10Name: bash
Umask: 0022
State: S (sleeping)
Tgid: 12345
Ngid: 0
Pid: 12345
PPid: 12340
TracerPid: 0
Uid: 1000 1000 1000 1000
Gid: 1000 1000 1000 1000Kernel and system information
/proc/version β kernel version + build
/proc/cmdline β kernel command line from boot
/proc/cpuinfo β CPU details (model, cores, flags)
/proc/cgroups β cgroup controller list and hierarchy info
/proc/meminfo β memory accounting
/proc/loadavg β load average (1, 5, 15 minute)
/proc/uptime β seconds since boot, idle seconds
/proc/filesystems β supported filesystem types
/proc/mounts β current mount table (also visible in /etc/mtab)
/proc/sys/ β sysctl knobs as files
/sys β devices, drivers, and kernel subsystems
/sys (sysfs) is also implemented by the kernel. It exposes the kernel
device model: every device, bus, driver, and class is represented as
a directory tree.
/sys/block/ β block devices (sda, nvme0n1, β¦)
/sys/class/ β device classes (net, power, thermal, β¦)
/sys/class/net/eth0/ β a specific NIC\'s state, speed, statistics
/sys/bus/ β registered buses (pci, usb, scsi, β¦)
/sys/fs/ β filesystem-specific knobs
/sys/kernel/ β kernel-wide settings (debug, security, β¦)
$ ls /sys/class/net/eth0
lo$ cat /sys/class/net/eth0/speed10000Illustrative output
A common production use: findmnt reads /proc/self/mountinfo and
/proc/mounts to report the current mount table.
/dev β device files
/dev exposes device files. Two flavours:
- Block device files (e.g.
/dev/sda,/dev/nvme0n1) β represent block-addressable storage. Read and written in fixed-size blocks. - Character device files (e.g.
/dev/null,/dev/tty,/dev/random) β character-stream or pseudo devices.
Modern distributions back /dev with devtmpfs, which is managed by
the kernel and udevd. udevd listens to kernel uevents and creates,
modifies, or removes device nodes in /dev as hardware comes and goes
(drives plugged in, NICs renamed, etc.).
/run β runtime state since boot
/run is tmpfs-backed, lives in memory, and is cleared on reboot. It
holds transient state that programs need to communicate with each other
across the boot session.
/run/systemd/ β systemd\'s runtime state
/run/systemd/resolve/ β systemd-resolved\'s resolver state
/run/dbus/ β D-Bus system bus socket
/run/chrony/ β chronyd drift tracking
/run/sshd/ β sshd privilege-separation directory
/run/lock/ β lockfiles; /var/lock is a symlink to here
Why a separate /run instead of stuffing everything into /var/run?
The split makes it explicit that this data is not preserved across
reboots. A /var/run of yesterday does not exist; only /run of today
does.
$ findmnt /runTARGET SOURCE FSTYPE OPTIONS
/run tmpfs tmpfs rw,nosuid,nodev,size=3254360k,nr_inodes=819200,mode=755What this lets you do
The four pseudo-filesystems convert kernel state into readable text. That gives you a handful of one-liners that are useful in production:
- Which process is using this port?
ss -tlnp 'sport = :443'prints the PID directly - start there, not in /proc. Once you have the PID,ls -l /proc/<pid>/fd/ | grep socketenumerates every socket that process holds. - What is the kernel command line?
cat /proc/cmdlineβ including thecrashkernel=reservation, root device, and anysystemd.unit=overrides. - Is this filesystem mounted?
cat /proc/mounts | grep <path>β/etc/mtabis usually a symlink here. - What CPU flags does this host expose?
grep ^flags /proc/cpuinfo | head -1β required for AES-NI, AVX, vmx/svm (virtualisation), and so on. - Why is /run filling? Use du -sh /run/* to see the breakdown. Usually a stray socket directory or a leftover lockfile
Knowledge check
Knowledge check Β· 3 questions
Q1. Where does Linux expose sysctl runtime knobs as files?
Q2. On a server with several storage controllers, /dev/sda can refer to a different physical disk after a reboot.
Q3. Which of the following live in tmpfs and are cleared on reboot? Select all that apply.
Passing score: 75%. Answers are checked in this browser.