38 Chapter 2. The /proc File System
cpu0 0 0
cpu1 11 3
• cwd — A symlink to the current working directory for the process.
• environ — Gives a list of the environment variables for the process. The environment variable is
given in all upper-case characters, and the value is in lower-case characters.
• exe — A symlink to the executable of this process.
• fd — A directory containing all of the file descriptors for a particular process. These are given in
numbered links:
total 0
lrwx------ 1 root root 64 May 8 11:31 0 -> /dev/null
lrwx------ 1 root root 64 May 8 11:31 1 -> /dev/null
lrwx------ 1 root root 64 May 8 11:31 2 -> /dev/null
lrwx------ 1 root root 64 May 8 11:31 3 -> /dev/ptmx
lrwx------ 1 root root 64 May 8 11:31 4 -> socket:[7774817]
lrwx------ 1 root root 64 May 8 11:31 5 -> /dev/ptmx
lrwx------ 1 root root 64 May 8 11:31 6 -> socket:[7774829]
lrwx------ 1 root root 64 May 8 11:31 7 -> /dev/ptmx
• maps — Contains memory maps to the various executables and library files associated with this
process. This file can be rather long, depending upon the complexity of the process, but sample
output from the sshd process begins like this:
08048000-08080000 r-xp 00000000 03:05 226209 /usr/sbin/sshd
08080000-08082000 rw-p 00037000 03:05 226209 /usr/sbin/sshd
08082000-080c3000 rwxp 00000000 00:00 0
40000000-40016000 r-xp 00000000 03:05 304721 /lib/ld-2.2.2.so
40016000-40017000 rw-p 00015000 03:05 304721 /lib/ld-2.2.2.so
40017000-40018000 rw-p 00000000 00:00 0
40019000-4001b000 r-xp 00000000 03:05 144433 /lib/security/pam_stack.so
4001b000-4001c000 rw-p 00001000 03:05 144433 /lib/security/pam_stack.so
• mem — The memory held by the process.
• root — A link to the root directory of the process.
• stat — A status of the process.
• statm — A status of the memory in use by the process. Sample statm files look like this:
140 72 63 22 0 50 22
The seven columns relate to different memory statistics for the process. In order of how they are
displayed, from right to left, they report different aspects of the memory used:
1. Total program size, in kilobytes
2. Size of memory portions, in kilobytes
3. Number of pages that are shared
4. Number of pages are code
5. Number of pages of data/stack
6. Number of pages of library
7. Number of dirty pages
• status — Provides the status of the process in a form that is much more readable than stat or
statm. Sample output for sshd looks similar to this:
Name: sshd
State: S (sleeping)
Pid: 14466
Commenti su questo manuale