[ Thanks to Jay Fink
for this link. ]
One of the more interesting aspects of certain flavors of UN*X
(Linux among them) is the /proc
filesystem. This
“virtual” filesystem has several key features which are
interesting, useful and helpful. It can also be dangerous and
disastrous. This column will approach the /proc
filesystem in three areas:
- A brief explanation of what it is
- What
/proc
can be used for (or sometimes
not to be used for) - A map of
/proc
as of the 2.2 Kernel on the i686
architecture…
The /proc
filesystem is a direct
reflection of the system kept in memory and represented in
a hierarchal manner. The effort of the /proc
filesystem is to provide an easy way to view kernel and information
about currently running processes. As a result, some commands (ps
for example) read /proc
directly to get information
about the state of the system. The premise behind
/proc
is to provide such information in a readable
manner instead of having to invoke difficult to understand system
calls.