15.10. Killing Misbehaved Apps

Well, this one is not so hard after all. Actually, it is not likely that you will need it but just in case you do... You have many ways to do it. You can do it by finding the PID of the program that has gone south, and use the kill to terminate it, or you can use the xkill tool or other graphical tools like the ones that show the process tree.

15.10.1. From The Console

The first thing to do to terminate a misbehaving program is to find its PID, or process ID. To do so, execute the following from a console: ps aux | grep netscape, supposing that netscape is the misbehaving program. You will get something like the following:
dodo      3505  7.7 23.1 24816 15076 pts/2   Z    21:29   0:02 /usr/lib/netscape
This tells us, among other things, that netscape was started by user dodo and has 3505 as its PID.

Now that we have the PID of the misbehaving program, we can proceed to execute the kill command to terminate it. So, we execute the following: kill -9 3505, and that's it! netscape will get killed. Note that this is only to be used when the program does not respond to your input anymore. Do not use it as a standard means to exit from applications.

Actually, what we have done was send the KILL signal to the process number 3505. The kill command accepts other signals besides KILL, so you can have greater control over your processes. For more info, see the man page for kill and the chapter "Process control".

15.10.2. Using XKILL

Mandrake Linux includes a graphical kill tool: xkill. It is useful to terminate misbehaved graphical applications with a single click. All you have to do is click on xkill's desktop icon and, when your mouse pointer changes to a skull and cross-bones, move it over the window of the application you want to kill and click on the window. That's it!

Tip

You can also access xkill with the following keyboard shortcut: CTRL+ALT+ESC (at least from KDE).

15.10.3. Using Other Graphical Tools

You can also one use the graphical process' status tools (like KPM, KSySGuard, and GTOP to name a few) which allow you to point to the process name and with one click send that process a signal or just kill that process.


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/