Chapter 3.
15
The
proc
File System
The Linux kernel has two primary functions: to control access to physical devices on the computer and
to schedule when and how processes interact with these devices. The
/proc/
directory — also called
the
proc
file system — contains a hierarchy of special files which represent the current state of the
kernel — allowing applications and users to peer into the kernel's view of the system.
Within the
/proc/
directory, one can find a wealth of information detailing the system hardware and
any processes currently running. In addition, some of the files within the
/proc/
directory tree can be
manipulated by users and applications to communicate configuration changes to the kernel.
3.1. A Virtual File System
Under Linux, all data are stored as files. Most users are familiar with the two primary types of files:
text and binary. But the
/proc/
directory contains another type of file called a
virtual file
. It is for this
reason that
/proc/
is often referred to as a
virtual file system
.
These virtual files have unique qualities. Most of them are listed as zero bytes in size and yet when
one is viewed, it can contain a large amount of information. In addition, most of the time and date
settings on virtual files reflect the current time and date, indicative of the fact they are constantly
updated.
Virtual files such as
/proc/interrupts
,
/proc/meminfo
,
/proc/mounts
, and
/proc/
partitions
provide an up-to-the-moment glimpse of the system's hardware. Others, like the
/
proc/filesystems
file and the
/proc/sys/
directory provide system configuration information and
interfaces.
For organizational purposes, files containing information on a similar topic are grouped into virtual
directories and sub-directories. For instance,
/proc/ide/
contains information for all physical IDE
devices. Likewise, process directories contain information about each running process on the system.
3.1.1. Viewing Virtual Files
By using the
cat
,
more
, or
less
commands on files within the
/proc/
directory, users can
immediately access enormous amounts of information about the system. For example, to display the
type of CPU a computer has, type
cat /proc/cpuinfo
to receive output similar to the following:
processor : 0
vendor_id : AuthenticAMD
cpu family : 5
model : 9
model name : AMD-K6(tm) 3D+
Processor stepping : 1 cpu
MHz : 400.919
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow k6_mtrr
bogomips : 799.53
Содержание ENTERPRISE LINUX 5 - VIRTUAL SERVER ADMINISTRATION
Страница 22: ...xxii ...
Страница 28: ......
Страница 36: ...10 ...
Страница 40: ...14 ...
Страница 96: ...70 ...
Страница 116: ...90 ...
Страница 144: ...118 ...
Страница 146: ......
Страница 158: ...132 ...
Страница 165: ...Installing and Removing Packages 139 Figure 11 7 Installing and removing packages simultaneously ...
Страница 166: ...140 ...
Страница 172: ...146 ...
Страница 178: ......
Страница 228: ...202 ...
Страница 264: ...238 ...
Страница 318: ...292 ...
Страница 330: ...304 ...
Страница 388: ...362 ...
Страница 428: ...402 ...
Страница 452: ......
Страница 458: ...432 ...
Страница 476: ...450 ...
Страница 478: ...452 ...
Страница 494: ...468 ...
Страница 498: ...472 ...
Страница 530: ...504 ...
Страница 536: ...510 ...
Страница 544: ...Chapter 36 Log Files 518 Figure 36 7 Log file contents after five seconds ...
Страница 546: ......
Страница 550: ...524 ...
Страница 576: ......
Страница 584: ...558 ...
Страница 608: ......
Страница 776: ...750 ...
Страница 796: ...770 ...
Страница 800: ...774 ...
Страница 804: ......
Страница 806: ...780 ...
Страница 808: ...782 ...
Страница 816: ...790 ...
Страница 820: ...794 ...
Страница 822: ...796 ...
Страница 830: ...804 ...
Страница 836: ...810 ...
Страница 844: ...818 ...
Страница 848: ...822 ...