|
Once you have listed
the processes with the ps
command you can terminate them with the kill
command. The kill
command is very useful for ending processes that have stopped responding
to user commands or that are taking an excessively long time to run.
Command Format
kill[-option]
job-id or
process-id
To terminate
a process:
1. Use ps
to find out the PID
for the process.
2. Type kill
followed by the PID listed by the ps
command.
Example
| $
ps |
|
|
|
| PID
|
TTY |
TIME
|
CMD |
| 830 |
pts/2 |
00:00:00 |
bash |
| 1016 |
pts/2 |
00:00:00 |
find |
| 1303 |
pts/2 |
00:00:00 |
ps |
| $kill |
1016 |
|
|
| $ |
|
|
|
If
you need to force the termination process, you can append the
-9 option to kill
the command:
$ kill
-9 PID
$
Warning:
Do not use the kill -9
command as the first step, because it does not allow the process
to terminate properly.
|