Close or Kill any crashed program in Ubuntu
When a Linux users wants to get rid of a crashed program, he kills it - literally. The kill command is used for this purpose, but it needs the program ID (PID) number to work. This can be discovered using the pgrep.
For example, let's say Firefox has crashed and won't respond to requests to quit. Open a terminal window, and type the following:
$ pgrep firefox
A three or (more likely) four digit number will be returned - something like 7198. All you need then do is type the following:
$ kill 7198
You might also try the killall command. This lets you specify the program name - killall firefox, for example.
The kill command has a more ruthless brother, designed to click-andkill GUI programs: xkill. Just type the command from a terminal window and, after the cursor has changed to a cross, click on the crashed program. It will be terminated instantly. If you decide to change your mind, right-clicking anywhere will cancel xkill. Bear in mind that xkill can also terminate components of the GNOME desktop, so if the panel stops responding, for example, it can be used.
Tags: kill,pgrep,PID,killall,xkill,gnome
Related Articles