Red Hat LINUX 7.2 - OFFICIAL LINUX CUSTOMIZATION GUIDE Guida di Installazione Pagina 24

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 282
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 23
24 Chapter 2. The /proc File System
As you view different virtual files in /proc, you will notice that some of the information makes sense.
Others are not human readable. This is why utilities exist pull data from virtual files in /proc and
display it in a useful way. Some examples of such applications are apm, free, and top.
Note
Some of the virtual files in /proc 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.su/jointfilesconvert/370363/bgenius.com > /proc/sys/kernel/hostname
Other files act as binary switches. For instance, if you type cat
/proc/sys/net/ipv4/ip_forward, you will get 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.
For a listing of some of the kernel configuration files available in the /proc/sys/, see Section 2.3.8.
2.2. Top-Level Files in /proc
Below is a list of some of the more useful virtual files in the top-level of the /proc directory.
2.2.1. /proc/apm
This file provides information about the state of the Advanced Power Management (APM) system.
This information is used by the apm command.
The output of this file on a system without a battery and constantly connected to an AC power source
looks similar to this:
1.16 1.2 0x03 0x01 0xff 0x80 -1% -1 ?
Executing apm -v command on these systems results in something similar to this:
APM BIOS 1.2 (kernel driver 1.16)
AC on-line, no system battery
For these systems, apm may be able to do little more than put the machine in standby mode. The apm
command is much more useful on laptops. This is also reflected in their /proc/apm files. This is the
output from a sample file on a laptop running Linux while plugged into a power outlet:
1.16 1.2 0x03 0x01 0x03 0x09 100% -1 ?
When the same machine is unplugged from its power source and running on its own batteries for a
few minutes, you will see the contents of the apm file change:
Vedere la pagina 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 ... 281 282

Commenti su questo manuale

Nessun commento