If you’re going to work with computers and Linux in particular, sooner or later you’ll need to perfect your killing technique. I’m not just talking about those useless defunct processes or applications that refuse to die – I’m also talking about the Operating System itself. When it comes to Windows you’re pretty limited to the confines of Ctrl+Alt+Del and the power switch, but with Linux, as with anything else, there are many ways to do things.
Force Quit Applications that Won’t Die (Gnome)
The first and easiest way to kill an application is to install the Force Quit button on your top or bottom panel. Right click on the panel, select “Add to Panel…” then scroll down and find Force Quit and select “Add”. This adds a little broken window icon to your panel when clicked on, turns your cursor into a deadly cross. With the cross, click on any window that refuses to die and usually it will be instantly gone.
If Force Quit is bit too brutal a method for you, you can always got to System -> Administration -> System Monitor, which is a bit like Windows Task Manager, to view processes in the Processes tab. Here you can choose to End an application in a softer way as well as reset its nice value (priority).
Kill that Lurking Background Process
Sometimes an application will seem to close normally, or even after a force quit, but will continue to skulk in the background, refusing to give up it’s entitlement to your cpu and memory. This is the Terminal comes in handy for terminating that rogue John Connor of processes.
Fire up the terminal (Applications -> Accessories -> Terminal) and type the following:
If you already know the name of the application or it’s not eating your cpu cycles you can use grep to filter all or part of the application name:
ps -ef | grep -i [ name of app ]
Note the process id (pid) of the rogue application taking up cpu then type:
kill -9 [pid]
Killing Applications that Crash your Desktop (X)
Of course, the above methods are not useful if an application has caused your desktop to seize up. Not to worry, Most distributions boot up with several virtual terminal sessions with X (the GUI desktop) running on only one of them.
When X crashes,
- Press Ctrl+Alt+F1. This will take you to the login prompt of the 1st of 6 terminals running.
- Login as root, or your user id then sudo to root.
- Run the top command to get a list of processes and PID numbers.
- Press Alt+F2 to log into the 2nd Terminal
- As with killing background processes above, you can simply type ‘kill -9 [pid]‘
- Press Alt+F7 to get back to your desktop and all should be well
Note: even if the desktop does not recover after killing the process, if you can access one of the other terminals, you can still do a hard reboot by typing:
shutdown -fr now
If all else fails….
Raise A Skinny Elephant
It may sound like some kind of incantation or ritual now needs to be performed, or possibly a mafia codeword for calling in a hit on your computer – but it’s really just a mnemonic device.
If your desktop has completely seized and none of the above will work, then just remember that
Raising Skinny Elephants Is Utterly Boring.
This will give you back control of your keyboard, sync your hdd, end all processes, and perform a manual but orderly reboot. Type in the following:
Alt+SysRq (+ letters below in order, pausing between key strokes)
+r = Put keyboard in raw mode (recapture your key presses)
+s = Sync the disk
+e = Terminate all processes
+i = Kill all processes
+u = Remount all filesystems Read-Only
+b = Reboot the system
On reboot let the system perform any filesystem checks and it will recover automatically.
If for some reason you can’t recall Skinny Elephants, or the thought grosses you out, you can always use BUSIER to help you remember – execute it backwards: (Alt+SysRq)+R+E+I+S+U+B.