On Windows anytime the system hangs Ctrl-Alt-Del brings up the Start Up Manager, from which you can end the program or process causing the hang.
Is there any command like this on Ubuntu?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
System Monitor shows you an overview of running applications (under the Processes tab) and allows you to end them by right-clicking on the name and selecting the respective context menu item. You can set up keyboard shortcuts in the Keyboard settings (Shortcuts tab), so you can bind Ctrl+Alt+Del to
gnome-system-monitor, the command to start System Monitor.
Another command you might be interested in is
xkill. This is traditionally bound to Ctrl+Alt+Esc (not sure if by default) and allows you to click on a misbehaving window to close it.
Both of these might not work if your entire system hangs. If that happens, there are two things you can do. The first has to be enabled in advance when your system doesn't hang yet (you could do it right now):
open Keyboard Layout settings (I believe this is merged into Keyboard in Ubuntu 12.04), then click Options. One of the options is Key sequence to kill the X server, you can click that run
gsettings get org.gnome.desktop.input-sources xkb-options for recent versions of Ubuntu (according to this answer). If you have done that and your system later hangs, you can press Ctrl+Alt+Backspace, which will effectively bring you back to the login screen.
If even that doesn't work, the last thing you can do is ensuring a sane shutdown (i.e. not pressing and holding the power button). This one is a bit hard to remember, but it involves pressing and holding Alt+SysRq (system request, often same key as PrtScr print screen) and then while holding those two keys press one at a time in order R, E, I, S, U, B (a mnemonic is Reboot Even If System Utterly Broken, but may also be easily remembered as "BUSIER" backwards). Wait a second between each press, because each letter is a different kernel action leading to a "graceful" reset.
To stay in the spirit of magical shortcuts, here are some :
ctrl+alt+F2 to F6, that will display a console from which you could login and then eventually kill the stucked application. Once you killed it you can return to the GUI by pressing alt-f7. Killing an application by name can be done by using this command:
sudo killall <name-of-the-application>
If this doesn't work, use the
-9 flag to kill it with überforce.
sudo killall -9 <name-of-the-application>
you could have a short command for opening a terminal, I have F4.
When you need to force an application to quit just open a terminal and type
xkill and then click in the window of the application that has crashed.
go down to the Desktop list, click on Run a terminal then hold your short command.
the short command should be visible in the line on the right.
Having a short command for opening a terminal is a good idea in general because you can do other things as well. (htop, system monitor, rebooting, etc.)
You can add a custom keyboard command using the following steps:
Note: on Ubuntu 14.10, Ctrl+Alt+Del is already in use, but can be overridden.
On Ubuntu 17.10 with GNOME, ALT+F4 is the default to close a window. As per this answer, after setting CTRL+ALT+Backspace to
gsettings get org.gnome.desktop.input-sources xkb-options, with the Brave browser open it just pulls down or up the menu toolbar, while with other applications it does nothing. CTRL+ALT+DEL will bring you back to the default screen after 60 s, at least if the system hasn't hung, and will pop up a window prompting to cancel or confirm log out. CTRL+ALT+ESC does nothing by default.
So if you want to bind opening the system monitor, either change the shortcut binding for log out to something else, or use another shortcut.
This is how to set a shortcut for
You can open this window by searching for keyboard shortcuts in activities. I've used CTRL+Suoer+ESC since CTRL+ALT+ESC is taken for switching the system controls directly (which toggles the menu toolbar in Brave, but in the terminal it doesn't seem to do anything).
gnome-system-monitor, I've chosen to bind it to CTRL+ALT+DEL, after changing the default/built-in log out shortcut from CTRL+ALT+DEL to CTRL+ALT+L.