How to close a program that has frozen.

stapiagutierrez
  14 years ago
  138

Although Linux is a really stable platform, there will be some times that a program will freeze. In those cases most people are stuck on what to do. This little guide is for them.

Generally you have two choices for closing a stuck program:

1. Close all programs related to that program (including multiple windows of the program)

2. Close a program with your mouse cursor.

I'll explain both a bit.

 

Use the KillAll feature to kill a program.

1. Press Alt+F2 and type in gnome-terminal to open a terminal session.

2. Inside of the terminal type in sudo killall <application-name>. For example, to kill firefox type in sudo killall firefox.

 

Use the xkill feature to kill a program you click on

1. Press Alt+F2 and type in gnome-terminal to open a terminal session.

2. Inside of the terminal type in sudo xkill; then click on any window to kill it. This command makes your cursor act like a terminator, deadly.

 

That's all there is to it. Hopefully you never experience a crash.

Comments
powerwagon75 7 years ago

xkill is great, if used with thought and caution, and only when all other options have been exhausted. Running Mint 18, and had an update to MintUpdate today, updater ran later, I updated a couple programs, and a dialog box hung afterwards that prevented MintUpdate from running any further checks. Could not get rid of it, could not find in any process list, or with ps -**, so tried xkill, and wham...Terminator is right!


ManuRahim 7 years ago

Great I learned something really cool today.


Code-Geass 8 years ago

Haha, I Struggled a lot for this...
Simple but Powerful commands.. Thanks :D..


chico34 8 years ago

Thanks.İts usefull.


Billyg237 9 years ago

Doesnt work on HP8440p notebook, have to power off & restart, seems to be msot prevalent watching youtube?


immortal222 9 years ago

thanks.very helpful!


ghasafello 9 years ago

Thanks, good tuto!


ratick 9 years ago

thanks for feedback guys. really glad to know my tut works even it's 4 yo.


skwaseem 9 years ago

Clear description. Thanks :)


Yash1 10 years ago

Worked Great!! Thanks for the simple and accurate description of how to do this.

:-)


jfleen 10 years ago

Nice tip. Thanks.


Angelanna81 10 years ago

Clear description. Thanks :)


jahid_0903014 10 years ago

awesome!


DestinTheGreat 11 years ago

thx


sujitnag 11 years ago

nice


jkumar 11 years ago

thanks a lot , It really helps


azimifm 12 years ago

u can add a shortcut for it on keyboard shourtcuts in system setting. on the buttom of the window there is a plus sign click on it
name: xkill
command: xkill
then add a shortcut, you can use ctrl+x as in ubuntu or anything you like


fanf42000 12 years ago

thank you.


revo 12 years ago

thank for your help!


j_rueger 12 years ago

Please edit your post and clarify that most of the time, xkill does not require sudo, just Alt+F2, enter "xkill" and kill away...


thanh4890 12 years ago

Very essential post, thank for your help!


pavankm 12 years ago

very helpful particularly when the main ui crashed.


davey1986 12 years ago

Thank you


BARN 13 years ago

hey stapia........my whole system freezes as soon as i try to start my webcam by the combination 'Fn+F10' which works perfctly fine in windows.Any idea about how to survive this instead of shuting down the system


SonhadorPR 13 years ago

You should also show us -newbies- how to find the processes.


kingugo 13 years ago

thanks. just killed a stubborn send to window with the sudo xkill command


blueXrider 13 years ago

Good to know for the new user


Steampunk-Nick 13 years ago

great tutorial!


mysoomro 13 years ago

Thanks. It's a really helpful tutorial.
Unfortunately I face this problem. Even bigger than this problem. My entire Mint OS freezes. And when it freezes, nothing works. And it happens very often. Can you help me out with this?
One friend in forum suggested that it might be because of low RAM. But I have 1 GB RAM. I think it's enough to run the system smoothly.


Angtagapagligt 13 years ago

There is a much comfortable way for the common user. Put the "force quit"-Button in your taskbar. Than click on it when a application hangs. An than click with your cursor on a window of the application. Ready.


dazw2000 13 years ago

Quality, as trying out all sorts of new stuff (BETA VERSIONS) now I can just close the window without the reset.


ibrahimsuprapto 13 years ago

That a simple great tutorial, Love it ! Thx bro :D


MintyFresco91 13 years ago

Its always nice to get more of a feel with the "F" keys. I can now say my mouse feels invincible, program terminated ;D.


soulsclerosis 13 years ago

A handy trick, thanks a lot.


Tonya 13 years ago

Many thanks to author and to all who proposed the alternative options.


gvhools 13 years ago

hello from greece.
very good,but some times we have zombies!


Firoz_usf 13 years ago

Thanks A MILLION .


Twix2247 13 years ago

thanks. I was wondering how to do this. I had my VLC player lock up for some reason once and just rebooted. This way is much simpler.


darwinarya 13 years ago

wow ... good one :)
thx for sharing


jrwilson 13 years ago

Good to know. Thanks.


jahwarrior4179 14 years ago

Being on a netbook, this will come in handy.


Ruth_Mary 14 years ago

In my opinion the best way to kill a frozen app is with the applet (see alphazero user at the end of this comment list). But there is another way that I have not readen in any comment here: System Monitor.


jxgreat 14 years ago

thankyou very muche very helpful.


Boringbytes 14 years ago

Thank you
comments on this tutorial are almost as interesting as the tutorial itself.


merelyjim 14 years ago

Funny that Linux uses terminology that the end-user understands ['killing' a Window]. Since I usually have the CLI open on at least one workspace anyway... KillAll!


grey1960envoy 14 years ago

very simple too bad the other guys (windoze) aren't this easy to figure out !!!


morbidtourus 14 years ago

nice share... i like xkill method that u shared...


Reves-Yosoy 14 years ago

Using the command '$ top' in a terminal will give us a list of all the processes running at the moment, to kill one, we just need to press 'k' in the keyboard and then, write the pid of the process (shown in the list we got) and press enter.
At least, I've done it this way with good results.


axelinux 14 years ago

I used to use ps aux | grep and then kill process by process


Apehanger 14 years ago

Love xkill. Ensure window is visible before calling it up.


elscripto 14 years ago

There is a third option suitable at cases, when the above pointed methods will not save you, simply because they are not applicable.

Sometimes, mostly at games, more specifically at Windows games played via Wine, the entire graphical screen freezes.
Ctrl-Alt-Del and Ctrl-Alt-Backspace are not options, as you want to kill only the faulty game/processes, and at the same time not to lose other running applications/processes.

The steps to kill the faulty process are:
1. Open another TTY console of your choice - Press one of Ctrl-Alt-F2 through Ctrl-Alt-F6 sequence;
2. Login at the console;
3. Navigate the processes by issuing the command: 'ps -ef | less' and find the frozen processes;
4. Escape from less and kill these processes with the command: kill pid1 pid2 ... pidN , substiting the correct values for the pids;
5. Switch and finally return to the original graphical screen by pressing Ctrl-Alt-F7.
Enjoy.


linXea 14 years ago

when something very bad happened to you, " kill -9 " is your friend. It will kill almost anything, succeed where "killall" fail.


TheBigGeeUK 14 years ago

I'm new to Linux Mint, in fact although I've used a few different distro's I'd still say I'm a linux newbie.

Never knew about the this, thanks for the tutorial!


ander 14 years ago

There are also times when a full-screen game crashes your desktop's video and gives you a black display---and you can't kill it because you can't see anything.

That's when I've found Ctrl+Alt+Backspace useful. It ends your desktop session and returns you to the logon screen. Of course if you have any open documents, you'll lose any unsaved data. But it's better than hitting your power switch. ;?)


justin 14 years ago

Additionally, I recommend adding that sometimes killall does not work. At that point you need to break out ' kill -9 ' which will absolutely kill whatever you want, no questions asked.


Darrel 14 years ago

Thanks, I'll go for the terminator next time, instead of a reboot.


vipek 14 years ago

Nice. I didn't know about xkill :)


srini2174 14 years ago

1. Click Ctrl + Alt + Esc
2. Click on the window which you need to kill.

This would kill the program that has frozen


alphazero 14 years ago

for additional of this tutorial :

we can use force quit applet that can be added in panel. Just click that applet, can click again which frozen application that want to be killed.