Q: Ubuntu 12.04 LTS: Need a way to recover from a system freeze I encounter often (deleting folders) Quick bit of context:


*

*This is a machine I use at work, and I have to use 12.04 LTS. I know it's old at this point, but I can't go to a newer version.

*I don't know much about the inner workings of the OS or how best to troubleshoot/fix things since I only use it at work.
The problem is trivial to reproduce for me on this machine, all it takes is deleting a folder (from the terminal) that I currently have open in "Files" (nautilus?).
I get a popup message that the folder is invalid ("the location is not a folder"), and everything freezes.
I can still move the mouse, but I can't click on anything.
I can switch to a fullscreen terminal with Ctrl+Alt+F2... but I can't figure out how to unfreeze my GUI.
Usually I am forced to reboot.
This happens to me fairly often because I sometimes have a folder in the build path for what I'm working on open in "Files" (nautilus?) and run the "clean" command in our build system which deletes that folder.
It's extremely frustrating.
Is there a reliable way to fix my gui when this happens without having to reboot? I tried using 'top' and killing random processes (including nautilus) but it never seems to really fix it.
Ideally, of course, this would never happen in the first place, I can't believe the file manager can't cleanly deal with a folder being deleted from under it. Maybe there's something in the way these machines are configured that causes it.

A: This happens to me often. After Ctrl-Alt-F2, I do this at full screen terminal
sudo service lightdm restart

This brings me back to login and saves a full restart.

A: To kill any GUI program which freezes use xkill command.
xkill is very useful in situations like these. I suggest you make a xkill keyboard shortcut.
