5.3. Sending signals to processes: kill, killall and top

5.3.1. kill, killall

These two commands are used to send signals to processes. The kill command requires a process number as an argument, while killall requires a command name.

Both of these commands can optionally receive a signal number as an argument. By default, they both send the signal 15 (TERM) to the relevant process(es). For example, if you want to kill the process with PID 785, you enter the command:
$ kill 785
If you want to send it signal 9, you enter:
$ kill -9 785
Suppose that you want to kill a process for which you know the command name. Instead of finding the process number using ps, you can kill the process directly:
$ killall -9 netscape
Whatever happens, you will only kill your own processes (unless you are root), so don't worry about the "neighbor's" processes with the same name, they will not be affected.

5.3.2. top

top is a program all in one: it simultaneously fulfills the functions of ps and kill. It is a console mode program, so you start it from a terminal, as shown in figure 5-1.

Figure 5-1. Example of execution of top

The program is entirely keyboard controlled. You can access help by pressing h. Here are some of the commands you can use.


Tux on Star from MandrakeSoft Linux is a registered trademark of Linus Torvalds. All other trademarks and copyrights are the property of their respective owners.
Unless otherwise stated, all the content of these pages and all images are Copyright MandrakeSoft S.A. and MandrakeSoft Inc. 2002.
http://www.mandrakelinux.com/