Device Files, /proc & /sys
Devices, /proc and /sys
Linux exposes hardware and kernel state as files.
/dev- device files.sda/nvme0n1(disks),tty(terminals),null,zero,random. Managed dynamically by udev./proc- virtual filesystem of the kernel & processes./proc/cpuinfo,/proc/meminfo,/proc/<pid>/./sys- sysfs: structured view of devices, drivers and kernel tunables.
Hardware discovery commands:
| Command | Shows |
|---|---|
lspci | PCI devices (GPU, NIC) |
lsusb | USB devices |
lsblk | Block devices (disks/partitions) |
lscpu | CPU architecture |
dmidecode | Firmware/DMI hardware info |
dmesg | Kernel ring buffer (boot & hardware messages) |
$ lscpu | grep '^CPU(s):'
CPU(s): 4
Try cat /proc/cpuinfo, lsblk, and dmesg | tail in the terminal below.