PoiNtEr->: Kill unresponsive program in Ubuntu(linux)

                             Difference between a dream and an aim. A dream requires soundless sleep, whereas an aim requires sleepless efforts.

Search This Blog

Sunday, July 10, 2011

Kill unresponsive program in Ubuntu(linux)




Ubuntu is a quite responsive operating system for our daily use. But beyond that,   there could be situations that might fall you into trouble when testing, running heavy-weight programs and facing exceptional situations when changing system settings. Ubuntu has an in built method to handle such situations. But what if it couldn’t? Hence, it’s always quite handy to know the proper ways of killing unresponsive programs to save your time.


With years of experience with Ubuntu I’m going to show you 3 easy ways to achieve this goal.




1. X Kill

Don't kill me Please!!
This is the most easiest way of killing unresponsive programs individually.

Press Alt+F2 and you’ll be presented with the Run Application box. Type xkill in it and press Enter.
Now your mouse pointer will be changed to a cross or a skull.
Click on the program window you want to close.

Xkill in Run


2. The Command Line Way – with ps Command!

Okay, here’s the scenario. Let’s say that you are developing a program or a 3D animation and it uses a heavy amount of resources. Now with the time your UI might get laggy and you want to clear up some unwanted resources which are running in the background (which you normally can’t see!).

It’s pretty simple. Just open up a terminal and enter this command.
ps -A[/bash]

This will show up each and every program that runs on your computer.

Now check the list it shows up to find the program you want to close.

Run this command in the same terminal.


kill -9

Note: replace "" with the process id you found.
 
Kill Command
 

Or if you know the program you want to close and you just want to search for its id you can use the grep command as follows:


ps -A | grep program_name


Replace program name with the program you want to kill.

For an example, let's say we want to find the process IDs of Transmission. The command would be:


ps -A | grep transmission



3. Killing the X Server


This is a handy feature, but for some odd reason they have disabled the key sequence of Ctrl+Alt+Backspace in Ubuntu 10.04/10.10 to kill and restart the X Server.



To enable it, open up a terminal and enter the following command:







gconftool-2 --type Boolean --set /desktop/gnome/interface/menus_have_icons True


   
   
Enabling Ctrl+Alt+Backspace



That's it! Now if somehow your Ubuntu box gets stuck you can always use Ctrl+Alt+Backspace to kill and restart the X Server.


Hope this post will save a lot time of our readers! We would be glad to hear your comments.

No comments:

Post a Comment