$linuxjunkies
>

sysfs

also: sysfs filesystem

A virtual filesystem that exposes kernel objects and device information as files and directories in /sys, allowing userspace programs to view and modify hardware settings and kernel parameters.

sysfs is a pseudo-filesystem mounted at /sys that provides a structured, hierarchical interface to kernel data structures. Unlike procfs, which focuses on process information, sysfs is designed to expose kernel objects like devices, drivers, and subsystems as a tree of files and directories.

The filesystem is dynamically generated by the kernel and updated in real-time as hardware is added or removed. Each device, bus, and driver typically has a corresponding directory under /sys containing attributes as files. For example, /sys/class/net/eth0/ contains network device settings, and /sys/devices/ shows the complete device hierarchy.

Users and tools can read from sysfs files to inspect hardware properties (like cat /sys/class/net/eth0/speed to check network speed) or write to certain files to modify kernel behavior without recompiling. This makes sysfs essential for hardware management, udev rules, and system monitoring utilities.

Related terms