Procfs
procfs (or the proc filesystem) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory. Typically, it is mapped to a mount point named /proc at boot time. The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change certain kernel parameters at runtime (sysctl).
More than a few operating systems support the proc filesystem, including Solaris, IRIX, Tru64 UNIX, BSD, Linux (Linux kernel extends it to non–process-related data), IBM AIX (which bases its implementation on Linux to improve compatibility), QNX, and Plan 9 from Bell Labs.
The proc filesystem provides a method of communication between kernel space and user space. For example, the GNU version of ps uses the procfs to obtain its data, without using any specialized system calls.
List of files
-
/proc/cmdline
- Kernel command line information. -
/proc/console
- Information about current consoles including tty. -
/proc/devices
- Device drivers currently configured for the running kernel. -
/proc/dma
- Info about current DMA channels. -
/proc/fb
- Framebuffer devices. -
/proc/filesystems
- Current filesystems supported by the kernel. -
/proc/iomem
- Current system memory map for devices. -
/proc/ioports
- Registered port regions for input output communication with device. -
/proc/loadavg
- System load average. -
/proc/locks
- Files currently locked by kernel. -
/proc/meminfo
- Info about system memory (see above example). -
/proc/misc
- Miscellaneous drivers registered for miscellaneous major device. -
/proc/modules
- Currently loaded kernel modules. -
/proc/mounts
- List of all mounts in use by system. -
/proc/partitions
- Detailed info about partitions available to the system. -
/proc/pci
- Information about every PCI device. -
/proc/stat
- Record or various statistics kept from last reboot. -
/proc/swap
- Information about swap space. -
/proc/uptime
- Uptime information (in seconds). -
/proc/version
- Kernel version, gcc version, and Linux distribution installed.