We use the /proc and /sys file systems in Linux to discover various types of system configuration information. Typically, we spelunk around through the different files and directories until we find the information that we need.
I'm wondering if anyone knows of a definitive resource that documents how one would navigate through the /proc and /sys file systems to locate specific information. We primarily grab USB, PCI and SCSI information from various files in these file systems.
Thanks,
Proc file system (procfs) is virtual file system created on fly when system boots and is dissolved at time of system shut down. It contains useful information about the processes that are currently running, it is regarded as control and information center for kernel.
The directory /proc contains (among other things) one subdirectory for each process running on the system, which is named after the process ID (PID).
The /proc/ directory (also called the proc file system) contains a hierarchy of special files which represent the current state of the kernel, allowing applications and users to peer into the kernel's view of the system.
/proc/PID/maps: It is a text file including details about mapped blocks and files (such as stack and heap). /proc/PID/root: It is a symlink to a root path as checked by a process. It is a link to the / directory for most of the processes unless a process is executing in a chroot jail.
The definitive resource for /sys
is Documentation/sysfs-rules.txt. The definitive resource for /proc/sys
is Documentation/sysctl/. The definitive resource for the rest of /proc
appears to be Documentation/filesystems/proc.txt. The rest of the Documentation/
directory in the Linux kernel source has other interesting information. In particular, Documentation/ABI/ mentions the stability of each interface.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With