00:00:02 httpd
140 S
99
145
121
0
69
0
-
859 wait_f ?
00:00:02 httpd
140 S
99
146
121
0
69
0
-
862 wait_f ?
00:00:02 httpd
140 S
99
147
121
0
69
0
-
855 wait_f ?
00:00:02 httpd
100 S
0
148
1
0
69
0
- 24123 wait_f ?
00:00:09 java
100 S
0
149
1
0
69
0
-
304 read_c tty1
00:00:00 agetty
000 S
0
150
1
0
69
0
-
304 read_c tty2
00:00:00 agetty
000 S
0
151
1
0
69
0
-
304 read_c tty3
00:00:00 agetty
000 S
0
152
1
0
69
0
-
304 read_c tty4
00:00:00 agetty
000 S
0
153
1
0
69
0
-
304 read_c tty5
00:00:00 agetty
000 S
0
154
1
0
69
0
-
304 read_c tty6
00:00:00 agetty
040 S
0
157
127
0
79
19
-
859 do_pol ?
00:00:00 dnetc
040 R
0
158
157 99
79
19
-
859 -
?
123-
19:52:07 dnetc

040 S
0
169
148
0
69
0
- 24123 do_pol ?
00:00:00 java
040 S
0
170
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
040 S
0
171
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
040 S
0
172
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
140 S
0
173
169
0
69
0
- 24123 nanosl ?
00:01:23 java
040 S
0
174
169
0
69
0
- 24123 nanosl ?
00:00:00 java
040 S
0
175
169
0
69
0
- 24123 nanosl ?
00:00:00 java
040 S
0
176
169
0
69
0
- 24123 nanosl ?
00:00:00 java
100 S
99
179
131
0
69
0
-
2465 do_pol ?
00:01:51 squid
040 S
0
180
169
0
69
0
- 24123 nanosl ?
00:00:00 java
000 S
99
181
179
0
69
0
-
300 pipe_w ?
00:00:00 unlinkd
040 S
0
183
169
0
69
0
- 24123 nanosl ?
00:00:00 java
040 S
0
184
169
0
69
0
- 24123 nanosl ?
00:00:00 java
140 S
0
185
169
0
69
0
- 24123 wait_f ?
00:00:00 java
040 S
0
191
169
0
69
0
- 24123 wait_f ?
00:00:00 java
040 S
0
192
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
040 S
0
193
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
040 S
0
194
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
040 S
0
195
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
040 S
0
196
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
040 S
0
197
169
0
69
0
- 24123 wait_f ?
00:00:00 java
140 S
99
708
121
0
69
0
-
862 wait_f ?
00:00:02 httpd
140 S
99
709
121
0
69
0
-
857 wait_f ?
00:00:02 httpd
140 S
99 32559
121
0
69
0
-
857 wait_f ?
00:00:02 httpd
140 S
99 12395
121
0
69
0
-
859 wait_f ?
00:00:02 httpd
140 S
99 17529
121
0
69
0
-
860 wait_f ?
00:00:02 httpd
140 S
0 23388
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
140 S
0 23389
169
0
69
0
- 24123 rt_sig ?
00:00:00 java
140 S
0 31584
77
0
69
0
-
1488 unix_s ?
00:00:00 sshd
140 S
1002 31586 31584
0
70
0
-
1336 do_sel ?
00:00:00 sshd

000 S
1002 31587 31586
0
72
0
-
502 wait4
pts/0
00:00:00 bash
000 R
1002 31612 31587
0
77
0
-
795 -
pts/0
00:00:00 ps
hong:~ $
As you can see most processes are run by the root and are not associated w with any
terminal (
TTY=?
). Some of these are daemons, or servers.
Another option
-H
displays the process hierarchy, ie parent-child relationship. For
example:
[email protected]:~$ ps -efH | grep S900432D
S900432D 32628 32625
0 21:19 ?
00:00:00
sshd:
[email protected]/0
S900432D 32629 32628
0 21:19 pts/0
00:00:00
-bash
S900432D
958 32629
0 22:20 pts/0
00:00:00
ps -efH
S900432D
959 32629
0 22:20 pts/0
00:00:00
grep
S900432D
[email protected]:~$
The above command line consists of two commands
ps -efH
and
grep S900432D
connected by a pipe ("|"), which links the standard output of the first command with
the standard input of the second command. The command
grep
picks up those input
lines that contains the string "S900432D". The output in the above command line
shows all processes started by the user "S900432D". It also reveals hierarchical
structures of these processes.
Try all commands used in this questions and try to understand the output with the help
of manual page of the
ps
command.
7.
Killing Processes
You can kill any process you own by sending the signal SIGKILL (signal 9). Firstly
you need to find out the PID of the process you want to kill, then use the command
kill -9
pid
Note you cannot kill a process that is owned by other users. However root can kill any
process.
