After the respected Ubuntarians have studied keyboard shortcuts with
Ctrl + Backspace and
Ctrl + SysRq + * , we can move to more mundane ways to remove stalled programs without destroying the entire workspace and unsaved documents.
Because of what the gnome hangs most often:1. Nautilus hangs when communication with smb / sftp / usb is lost, sometimes with drag-n-drop
2. When copying huge texts into or out of a text editor
3. OpenGL screensavers sometimes manage to overload the processor and do not allow it into the system.
4. Hangs all beloved monster - Firefox
The system is frozen, the mouse is moving. (the most universal option)Press
Ctrl + Alt + F1 , get into the text terminal (for laptops on the external screen - look at the laptop screen).
Thanks to odessky for reminding that the same method is also relevant for external connection via SSH if your system is so blocked that it does not respond to keystrokes.
Log in to the system under your login and get to the command line:
genius@notable:~$
Enter the command top (enter)
In response, we get a sign of the form:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12218 genius 20 0 377m 252m 29m S 90 8.3 16:27.35 firefox
16633 genius 20 0 2304 1052 764 R 4 0.0 0:00.02 top
10501 root 20 0 69176 61m 7204 S 2 2.0 7:51.39 Xorg
In this example, we see that the firefox process is hanging (% CPU).
By pressing the hot key k we get the ability to reprint the PID of our ill-fated process.
PID to kill:We enter 12218 (enter)
')
Now we see a calmed system. Go back to the graphic terminal by pressing
Ctrl + Alt + F7Instead of top, we can use the ps command like this:
For example, we are sure that nautilus is frozen:
ps aux | grep nautilus
Using
| grep nautilus we filter out the necessary keywords from the “sheet”. As you will see below, the team that we give will also fall here.
genius@notable:~$ ps auxw | grep nautilus
genius 6943 0.0 1.0 81744 31412 ? Sl Nov11 0:05 nautilus --no-default-window --sm-client-id default2
genius 16962 0.0 0.0 3008 780 pts/0 R+ 19:04 0:00 grep nautilus
And we kill the disagreeable process:
genius@notable:~$ kill 6943
You may have to add the
-9 parameter (SIG_KILL) if the process does not want to end.
Now, having studied the basics, we can automate the process of merciless murder:This tip concerns the configuration of
Gnome + Metacity (i.e. most ubuntarians). In KDE and XFSE, the combination for launching xkill - Ctrl + Alt + Esc is configured by default.
Run gconf-editor from the console or from the Main Menu: Applications -> System Tools -> Configuration Editor (sorry for my english interface)
In the configurator, go to apps -> metacity -> keybinding_commands and select the first free cell, for example command_1, double-click and enter the value
xkillGo to the apps -> metacity -> global_keybindings section and find there run_command_1 (the number corresponds to the command number) and write to the value for example:
<Control><Shift>F1
(you can make variants of the names of special combinations by analogy with the next section entries)
Voila! Now, to celebrate, you can press
Ctrl + Shift + F1 (the cursor will turn into an ominous cross) and give the first victim to the bloodthirsty xkill! Left click on the application window - it kills the application that originated it (note that clicking on the panel will kill the gnome-panel and not the application that is displayed in it), right click - cancels the kill.
As the commentators rightly noted - xkill does not guarantee complete destruction of the application, it disconnects the hung application from the session and gives it a signal to end. The application, in turn, can ignore this signal. To do this, you already need to use one of the options kill, killall with the
-9 parameter (SIG_KILL).