Unfreezing Your Linux Desktop
A friend of mine writes “…when I open some heavy sites with Firefox, my Ubuntu desktop gets freeze. I can’t close the Firefox so I find no other way than to restart my system. Aren’t there any other ways to unfreeze the system without restarting?”
Yes there are!
The most efficient way to unfreeze your system is to be patience. Don’t try to open other applications, when your system is not responding. Don’t press unnecessary keys. Go have a cup of coffee, get fresh and get back. You system might have already been unfrozen or a dialog box might be waiting for you to click on that Force Quit button. (I promise you won’t be greeted by BSOD!)
If you don’t have much patience or your system just can’t unfreeze automatically, then follow these steps:
- Hit Caps Lock or Num Lock keys to see if your keyboard is responding, if it isn’t than you’re out of luck.
- Press Ctrl+Alt+F2, you will be taken to a black&white terminal window. It will ask you for your username and password.
- Type the following command to get the PID (process ID) of the program that is not responding (in this example Firefox)
ps -A | grep firefox - It will display you the PID of firefox. You should get at least two PIDs something similar to:
5961 ? 00:00:00 firefox-2
5977 ? 00:01:12 firefox-2-bin - Now issue the following command to kill the non-responding firefox (its PID is 5977 in this example)
kill 5977
[update: If you hate working with numbers you can also kill the non-responding program by issuing: killall firefox-2-bin] - Re-check that you have successfully killed the non-responding program:
ps -A | grep firefox - If it doesn’t show you anything, then you are done. To exit and get back to your Graphical System, press Ctrl+Alt+F7
No related posts.
anon Says:
you can run pidof to get the pid of a program too -
pidof firefox
and if something won’t die you can run kill with the 9 option to make sure it’s killed -
kill -9 xxxx
the main difference between killall and using the pid is killall kills all running instances of the program
you can run xkill too and click on the program you want to kill. ctrl-c cancels it
pkill firefox will kill everything with firefox in the name, so if you can’t remember firefox-bin, but know it has firefox in the name you can use that, but you have to be careful incase you kill stuff you don’t want to!
Posted on June 5th, 2008 at 12:52 pm
Mike Tyrell Says:
hey there I am a new user
cant you just type in terminal killall firefox-bin ?
it works for me
Posted on June 5th, 2008 at 6:29 pm
brodie Says:
you are my hero. i’ve had issues in the past where the ctrl-alt-backspace doesn’t work and I can never remember the alt-sysrq combo. this is much easier, thank you
Posted on July 1st, 2008 at 4:15 am
bob Says:
for i in `ps -ef | grep firefox | grep -v grep | awk ‘{ptint $2}’`; do kill $i; done
Posted on October 15th, 2008 at 8:35 am
Chady Says:
Compiz has some issues on my system too sometimes.
It locks up the desktop, the mouse moves, but the keyboard doesn’t work and the desktop is frozen.
The course of action I take is to ssh in from another machine and kill/restart compiz.
You’re out of luck if you don’t have another machine on the same network though.
Posted on October 26th, 2008 at 3:46 am