/proc and Its "Files"

The /proc directory contains special "files" that either extract information from or send information to the kernel.

However, the /proc directory is much more powerful than you might initially think. Through the various "files" in this directory (which are really not files at all but interfaces into the kernel), a system administrator can use /proc as an easy method of accessing information about the state of the kernel, the attributes of the machine, the states of individual processes, and more. By using cat in combination with the interfaces within /proc, you can immediately access an enormous amount of information about any system. As an example, if you want to see how the memory registers are currently assigned on your computer:

[truk@tictactoe /proc]$ cat iomem  
00000000-0009fbff : System RAM
0009fc00-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000f0000-000fffff : System ROM
00100000-07ffffff : System RAM
  00100000-002553d7 : Kernel code
  002553d8-0026d91b : Kernel data
e0000000-e3ffffff : VIA Technologies, Inc. VT82C597 [Apollo VP3]
e4000000-e7ffffff : PCI Bus #01
  e4000000-e4003fff : Matrox Graphics, Inc. MGA G200 AGP
  e5000000-e57fffff : Matrox Graphics, Inc. MGA G200 AGP
e8000000-e8ffffff : PCI Bus #01
  e8000000-e8ffffff : Matrox Graphics, Inc. MGA G200 AGP
ea000000-ea00007f : Digital Equipment Corporation DECchip 21140
  ea000000-ea00007f : eth0
ffff0000-ffffffff : reserved
[truk@tictactoe /proc]$ 

Or (and more usefully), if were connecting to an unknown machine and wanted to know its CPU type and speed, you can use the following command:

cat /proc/cpuinfo

Other valuable bits of system information can be gathered from cmdline, meminfo, partitions, and version, among others.

The directories in /proc symbolize a collection of information about a particular application or process. For example, the /proc/sys/kernel directory is full of information about the kernel, such as the maximum number of threads (threads-max) and the maximum number of messages (msgmax).