Linux Know-How provides a collection of introductory texts on often needed Linux skills.


More about the /proc file system

The /proc "pseudo" file system is a real-time, memory-resident file system that tracks the state of the operating system kernel and the processes running on your computer. The /proc file system is totally virtual, i.e., it is not written on any particular disk or other persistent media, it exists only in the computer memory, and it is constantly updated to reflect any changes to your system. The size of the /proc directory is always zero and the last modification time is the current date. In some cases, it is possible to change your system settings by manually changing the contents of files in the /proc file system. Many Linux utilities use the /proc file system as the source of their information, e.g., dmesg, ps, top.

Contents of the /proc file system

Directories with numerical names like "1" "170" "4908" are IDs of the processes running on your computer. Each directory contains several files, e.g.,: cmdline (contains the entire command line that was used to invoke the process), cwd (symbolic link to the cwd of the process), environ (the environment variables defined for this particular process in the form VARIABLE=value), exe (a symbolic link to the executable file that the current process is linked to), fd (a list of the file descriptors opened by the process),maps (a named pipe that can be used to access the process memory), root (a symbolic link to the directory which is the root file system for the particular process), stat (info on the status of the process).

Other files in the /proc file system:

/proc/cpuinfo --information about the processor, such as its type, make, model, and performance.

/proc/devices --list of device drivers configured into the currently running kernel.

/proc/dma --DMA channels being used at the moment.

/proc/file systems --file system types configured into the kernel.

/proc/interrupts --interrupts in use, and how many of each there have been.

/proc/ioports --I/O ports in use at the moment.


For example, I can read the cpu info on my system using the following command:

cat /proc/cpuinfo


Last Update: 2010-12-16