When viewing different virtual files in the
/proc/
file system, 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. Examples of these utilities include
lspci
,
apm
,
free
, and
top
.
Note
Some of the virtual files in the
/proc/
directory are readable only by the root
user.
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 greater than symbol (
>
) to
redirect the new value to the file. For example, to change the hostname on the fly, type:
echo www.example.com > /proc/sys/kernel/hostname
Other files act as binary or boolean switches. Typing
cat /proc/sys/net/ipv4/ip_forward
returns either a
0
or a
1
. A
0
indicates that the kernel is not forwarding network packets. Using
the
echo
command to change the value of the
ip_forward
file to
1
immediately turns packet
forwarding on.
Tip
Another command used to alter settings in the
/proc/sys/
subdirectory is
/sbin/sysctl
. For more information on this command, refer to
Section 4, “Using
the
sysctl
Command”
For a listing of some of the kernel configuration files available in the
/proc/sys/
subdirectory,
refer to
Section 3.9, “
/proc/sys/
”
.
2. Top-level Files within the
proc
File System
Below is a list of some of the more useful virtual files in the top-level of the
/proc/
directory.
Chapter 5. The proc File System
50
Summary of Contents for ENTERPRISE LINUX 4.5.0 -
Page 1: ...Red Hat Enterprise Linux 4 5 0 4 5 0 Reference Guide ISBN N A Publication date ...
Page 2: ...Red Hat Enterprise Linux 4 5 0 ...
Page 4: ...Red Hat Enterprise Linux 4 5 0 ...
Page 24: ...xxiv ...
Page 26: ......
Page 36: ...12 ...
Page 72: ...48 ...
Page 112: ...88 ...
Page 122: ...98 ...
Page 140: ...116 ...
Page 142: ......
Page 300: ...276 ...
Page 318: ...294 ...
Page 320: ......
Page 332: ...308 ...
Page 350: ...326 ...
Page 378: ...354 ...
Page 388: ...364 ...
Page 394: ...370 ...
Page 395: ...Part IV Appendixes ...
Page 396: ......