Using the Contents of the /proc Directory to Interact with the Kernel

The content of the /proc directory is created from memory and exists only while Linux is running. This directory contains special files that either extract information from or send information to the kernel. Many Linux utilities extract information from dynamically created directories and files under this directory, also known as a virtual file system. For example, the free command obtains its information from a file named meminfo:

matthew@seymour:~$ free          total       used       free      shared   buffers     cachedMem:      4055680     2725684    1329996   0        188996      1551464-/+ buffers/cache:    985224     3070456Swap:     8787512     0          8787512 ...

Get Ubuntu Unleashed 2014 Edition: Covering 13.10 and 14.04,Ninth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.