Skip to content

/proc Filesystem

The proc file system contains a hierarchy of special files that represent the current state of the kernel.

Files in the /proc directory contain information about the hardware and current processes running on the system. Files that have write permission can be modified to change the configuration of the kernel.

Top-Level Files Within /proc

  • /proc/buddyinfo: This file is used primarily for diagnosing memory fragmentation issues.

  • /proc/cmdline: This file shows the parameters passed to the kernel at the time it is started.

  • /proc/cpuinfo: This virtual file identifies the type of processor used by the system.

  • /proc/crypto: This file lists all installed cryptographic ciphers used by the Linux kernel, including additional details for each.

  • /proc/devices: This file displays the various character and block devices currently configured (not including devices whose modules are not loaded).

  • /proc/dma: This file contains a list of the registered ISA DMA channels in use.

  • /proc/execdomains: This file lists the execution domains currently supported by the Linux kernel, along with the range of personalities they support.

  • /proc/filesystems: This file displays a list of the file system types currently supported by the kernel.
    The first column signifies whether the file system is mounted on a block device. Those beginning with nodev are not mounted on a device.
    The second column lists the names of the file systems supported.
    The mount command cycles through the file systems listed here when one is not specified as an argument.

  • /proc/interrupts: This file records the number of interrupts per IRQ on the x86 architecture.

  • /proc/iomem: This file shows the current map of the system’s memory for each physical device.

  • /proc/ioports: This file provides a list of currently registered port regions used for input or output communication with a device.

  • /proc/kcore: This file represents the physical memory of the system and is stored in the core file format. The contents of this file are designed to be examined by a debugger, such as gdb, and is not human readable.

  • /proc/kmsg: This file is used to hold messages generated by the kernel. These messages are then picked up by other programs, such as /bin/dmesg.

  • /proc/loadavg: This file provides a look at the load average in regard to both the CPU and I/O over time, as well as additional data used by uptime and other commands.

  • /proc/locks: This file displays the files currently locked by the kernel. The contents of this file contain internal kernel debugging data and can vary tremendously, depending on the use of the system.

  • /proc/mdstat: This file contains the current information for multiple-disk, RAID configurations.

  • /proc/meminfo: This file reports a large amount of valuable information about the system’s RAM usage.

  • /proc/modules: This file displays a list of all modules loaded into the kernel. Most of this information can also be viewed by using the /sbin/lsmod command.

Process Directories in /proc

The /proc directory contains directories with numerical names. These directories are named after a program’s process ID and contain information about that process. The owner and group of each process directory are set to the user running the process.

Each /proc/<pid> directory contains several files including:

  • cmdline: The command issued when starting the process
  • cwd: A symbolic link to the current working directory for the process
  • environ: A list of the environment variables for the process
  • exe: A symbolic link to the executable of this process
  • fd: The directory containing all of the file descriptors for a particular process
  • maps: A list of memory maps to executables and library files associated with process
  • mem: The memory held by the process (the file cannot be read by the user)
  • root: A link to the root directory of the process
  • stat: The status of the process including run state and memory usage
  • statm: The status of the memory in use by the process
  • status: The status of the process in a more readable form than stat or statm

Other Directories in /proc

Other directories within the /proc directory group similar information by topic. The following is a partial list of these directories:

  • /proc/bus: This directory contains information about the various buses available on the system. The subdirectories and files available within /proc/bus vary depending on the devices connected to the system.

  • /proc/bus/pci, /proc/bus/usb: It's possible to get a list of all PCI and USB devices present on the system by using the cat command on the devices file within these directories, but the output is difficult to read and interpret.
    For a human-readable list of devices, run the lspci and lsusb commands.

  • /proc/driver: This directory contains information for specific drivers in use by the kernel.

  • /proc/fs: This directory shows which file systems are exported.

  • /proc/irq: This directory is used to set IRQ to CPU affinity, which allows the system to connect a particular IRQ to only one CPU. Alternatively, it can exclude a CPU from handling any IRQs.

  • /proc/self/net: This directory provides a comprehensive look at various networking parameters and statistics. Each directory and virtual file within this directory describes aspects of the system’s network configuration. The /proc/net file is a symbolic link to this directory.

  • /proc/scsi: The primary file in this directory is /proc/scsi/scsi, which contains a list of every recognized SCSI device. From this listing, the type of device, as well as the model name, vendor, SCSI channel, and ID data is available.

  • /proc/sys: This directory is different from others in /proc, because it not only provides information about the system but also allows to immediately enable and disable kernel features.
    Changes made by writing to the files are not persistent and disappear when the system is restarted. To make changes persist after rebooting, add them to the /etc/sysctl.conf file.

  • /proc/sys/dev: This directory provides parameters for particular devices on the system.

  • /proc/sys/fs: This directory contains options and information concerning various aspects of the file system, including quota, file handle, and inode information.

  • /proc/sys/kernel: This directory contains a variety of different configuration files that directly affect the operation of the kernel.

  • /proc/sys/net: This directory contains subdirectories concerning various networking topics. Ir's possible to alter the files within these directories to adjust the network configuration on a running system.

  • /proc/sysvipc: This directory contains information about System V Interprocess Communication (IPC) resources. The files in this directory relate to System V IPC calls for messages (msg), semaphores (sem), and shared memory (shm).

  • /proc/tty: This directory contains information about the available and currently used tty devices on the system. The drivers file is a list of the current tty devices in use.