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

13.3.1. Shortcut in X: xkill

If you are using KDE, there is a shortcut for killing a blocked X process. There is a very easily identifiable icon on the desktop, reproduced here:

Figure 13-1. xkill icon

This icon activates the command xkill which you can run from a terminal. When you click on this icon (or start the program from your terminal), the mouse cursor changes. You then left-click on the window corresponding to the process you want to kill.

13.3.2. kill, killall

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

The two 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.

13.3.3. 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, like it is shown in figure 13-2.

Figure 13-2. 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. 2000.
http://www.linux-mandrake.com/