Chapter 2. The /proc File System 39
PPid: 723
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 32
Groups:
VmSize: 3596 kB
VmLck: 0 kB
VmRSS: 288 kB
VmData: 552 kB
VmStk: 28 kB
VmExe: 224 kB
VmLib: 2596 kB
SigPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 8000000000001000
SigCgt: 0000000000012000
CapInh: 0000000000000000
CapPrm: 00000000fffffeff
CapEff: 00000000fffffeff
Other than the process’s name and ID, the state (such as S (sleeping) or R (running) and
user/group ID running the process is available, as well as much more detailed data regarding mem-
ory usage.
2.3.1.1. /proc/self/
The /proc/self/ directory is a link to the currently running process. This allows a process to look
at itself without having to know its process ID.
Within a shell environment, a listing of the /proc/self/ directory produces the same contents as
listing the process directory for that process.
2.3.2. /proc/bus/
This directory contains information specific to the various buses available on the system. So, for
example, on a standard system containing ISA, PCI, and USB busses, current data on each of these
buses is available in its directory under /proc/bus/.
The contents of the subdirectories and files available varies greatly on the precise configuration of
your system. However, each of the directories for each of the bus types has at least one directory for
each bus of that type. These individual bus directories, usually signified with numbers, such as 00,
contains binary files that refer to the various devices available on that bus.
So, for example, a system with a USB bus but no USB devices connected to it has a /proc/bus/usb
directory containing several files:
total 0
dr-xr-xr-x 1 root root 0 May 3 16:25 001
-r--r--r-- 1 root root 0 May 3 16:25 devices
-r--r--r-- 1 root root 0 May 3 16:25 drivers
[root@thoth /]# ls -l /proc/bus/usb/001
total 1
-rw-r--r-- 1 root root 18 May 3 16:25 001
The /proc/bus/usb directory contains files that track the various devices on any USB buses, as well
as the drivers required to utilize them. The 001 directory contains all devices on the first USB bus. By
looking at the contents of the devices file, we can see that it is the USB root hub on the motherboard:
Commenti su questo manuale