sysfs 2022-12-14
sysfs
In addition to /proc, the kernel also exports information to another virtual file system called sysfs.
sysfs is used by programs such as udev to access device and device driver information.
/sys/class
This directory contains every device class registered with the kernel. Device classes describe a functional type of device. Examples include input devices, network devices, and block devices.
Difference between /dev and /sys/class
The files in /dev
are actual devices files which UDEV creates at run time.
The directory /sys/class
is exported by the kernel at run time, exposing the hierarchy of the hardware through sysfs.
/sys/class/net
Each of the entries in this directory is a symbolic link representing one of the real or virtual networking devices that are visible in the network namespace of the process that is accessing the directory.
Each of these symbolic links refers to entries in the /sys/devices directory.