lecture
in color

vmstatvmstat
lin09{couch}54: vmstat
procs memory swap io system cpu
r b w swpd free buff cache si so bi bo in cs us sy id
1 0 0 0 2780 44568 46172 0 0 1 2 19 2 0 0 9


vmlinux)
itself.
psps: tell me about my processes:
lin09{couch}74: ps
PID TTY TIME CMD
12946 pts/1 00:00:00 tcsh
13141 pts/1 00:00:00 ps
ps -e: tell me about all processes:
lin09{couch}75: ps -e
PID TTY TIME CMD
1 ? 00:00:07 init
2 ? 00:00:00 keventd
3 ? 00:00:00 kapmd
4 ? 00:00:02 ksoftirqd_CPU0
9 ? 00:00:00 bdflush
5 ? 00:00:02 kswapd
6 ? 00:00:00 kscand/DMA
7 ? 00:00:00 kscand/Normal
8 ? 00:00:00 kscand/HighMem
10 ? 00:00:00 kupdated
11 ? 00:00:00 mdrecoveryd
...
16238 ? 00:00:01 httpd
16239 ? 00:00:01 httpd
16240 ? 00:00:01 httpd
12943 ? 00:00:00 sshd
12945 ? 00:00:00 sshd
12946 pts/1 00:00:00 tcsh
13142 pts/1 00:00:00 ps
ps -ef: tell me most everything about processes
lin09{couch}76: ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Jan06 ? 00:00:07 init
root 2 1 0 Jan06 ? 00:00:00 [keventd]
root 3 1 0 Jan06 ? 00:00:00 [kapmd]
root 4 1 0 Jan06 ? 00:00:02 [ksoftirqd_CPU0]
root 9 1 0 Jan06 ? 00:00:00 [bdflush]
root 5 1 0 Jan06 ? 00:00:02 [kswapd]
root 6 1 0 Jan06 ? 00:00:00 [kscand/DMA]
root 7 1 0 Jan06 ? 00:00:00 [kscand/Normal]
root 8 1 0 Jan06 ? 00:00:00 [kscand/HighMem]
root 10 1 0 Jan06 ? 00:00:00 [kupdated]
root 11 1 0 Jan06 ? 00:00:00 [mdrecoveryd]
...
apache 16238 747 0 Jan25 ? 00:00:01 /usr/sbin/httpd
apache 16239 747 0 Jan25 ? 00:00:01 /usr/sbin/httpd
apache 16240 747 0 Jan25 ? 00:00:01 /usr/sbin/httpd
root 12943 672 0 16:30 ? 00:00:00 /usr/sbin/sshd
couch 12945 12943 0 16:30 ? 00:00:00 /usr/sbin/sshd
couch 12946 12945 0 16:30 pts/1 00:00:00 -tcsh
couch 13153 12946 0 16:44 pts/1 00:00:00 ps -ef

/usr/bin/gcc, it's
easy to get to the inode of the file.
This is a list traversal.
42, it's hard to
get back the pathname. This requires traversing
to parents.
Inode | First block
1 | 40 (dir)
3 | 45 (dir)
4 | 20 (file)
8 | 34 (dir)
and the following list of blocks, containing directories:
Block | Pathname | Inode
-------+------------+---------
34 | foo | 1
| bar | 4
-------+------------+---------
40 | cat | 3
| dog | 8
-------+------------+---------
45 | cat | 4
| dog | 8
Suppose the root inode is 8 and that this
describes a root filesystem, starting at '/' with inode 8.
Then:
lecture
in color