whatis sysfs

/sys (sysfs)

Also known as: sysfs

A virtual filesystem that exposes the kernel's view of devices, drivers, and buses as a structured directory tree.

What Is /sys (sysfs) in Linux?

Where /proc grew organically around processes, /sys is organized around the device model. You can read a battery's charge, a disk's scheduler, or a network card's driver by browsing directories under /sys/class and /sys/block.

Some files are writable and change hardware behavior immediately, such as screen brightness or CPU frequency governors. udev watches sysfs events to create device nodes and run rules.

Example

cat /sys/class/power_supply/BAT0/capacity