Installation guide
24 Chapter 2. The proc File System
When viewing different virtual files in the /proc/ file system, you will notice some of the information
is easily understandable while some is not human-readable. This is in part why utilities exist to pull
data from virtual files and display it in a useful way. Some examples of such applications are lspci,
apm, free, and top.
Note
Some of the virtual files in the /proc/ directory are only readable by the root user.
2.1.2. Changing Virtual Files
As a general rule, most virtual files within the /proc/ directory are read only. However, some can be
used to adjust settings in the kernel. This is especially true for files in the /proc/sys/ subdirectory.
To change the value of a virtual file, use the echo command and a
symbol to redirect the new value
to the file. For instance, to change your hostname on the fly, you can type:
echo bob.subgenius.com > /proc/sys/kernel/hostname
Other files act as binary or boolean switches. For instance, if you type cat
/proc/sys/net/ipv4/ip_forward, you will see either a 0 or a 1. A 0 indicates the kernel is not
forwarding network packets. By using the echo command to change the value of the ip_forward
file to 1, you can immediately turn packet forwarding on.
Tip
Another command used to alter settings in the /proc/sys/ subdirectory is /sbin/sysctl. For more
information on this command, see Section 2.4
For a listing of some of the kernel configuration files available in the /proc/sys/, see Section 2.3.9.
2.2. Top-level Files in the proc Filesystem
Below is a list of some of the more useful virtual files in the top-level of the /proc/ directory.
Note
In most cases, the content of files listed in this section will not be the same on your machine. This is
because much of the information pertains to the hardware on which you are running Red Hat Linux.
2.2.1. /proc/apm
This file provides information about the state of the Advanced Power Management (APM) system and
is used by the apm command. If the system with no battery is connected to an AC power source, this
virtual file looks similar to this:
1.16 1.2 0x07 0x01 0xff 0x80 -1% -1 ?