Although Linux is very stable in running apps, sometimes it freezes. You might think that restarting your Linux is the best solution to that situation. However, many other alternatives can quickly and easily help you to exit this non-responsive application safely.
In this tutorial, we’re going to cover the best methods to kill non-responsive applications on your Linux system.
- Close software using the kill command
- Exit applications using the pkill command
- Kill applications using the killall command
- Kill system processes using the xkill command
- Creating a keyboard shortcut to kill applications
- Exit software using the system monitor application
- Closing the application by clicking on the “X” button in the top corner
Method 1: Close software using the kill Command
One of the most common methods for killing unresponsive applications is to use the kill command. However, before using the kill command, we need first to get the unresponsive application ID.
You can get the unresponsive process ID using the following command:
ps -aux | grep application_name
The command should list all the running processes with the name firefox. As you can see in the above screenshot, the process ID is 3993.
Now you can use the kill command to kill the unresponsive application.
kill 3993
Another way of getting the process ID is by using the command:
pgrep application_name
Now use the kill command:
kill 4401
Method 2: Exit Applications Using The pkill Command
What if you do not have the process ID or can not find the exact process ID because several processes have the same name. You can use the pkill command. In this method, we shall use the pkill command alongside the unresponsive application name.
pkill application_name
Method 3: Kill Applications Using The killall Command
In this method, we shall use the killall command along with the application name. The killall command terminates all the application instances. So in case, you have many opened windows of the same program then the killall command should close all the opened windows.
killall application_name
Method 4: Kill System Processes Using The xkill Command
In this method, we shall use the pre-installed kill utility in Ubuntu which is the xkill command.
xkill
As you can see in the above screenshot when the xkill command is invoked, the mouse pointer should display a “cross.” Then you can click on the unresponsive application to close it.
Method 5: Creating A Keyboard Shortcut To Kill Applications
In this method, we shall create a keyboard shortcut to give an immediate command to close the unresponsive application. This keyboard shortcut depends on the xkill command as you shall see next.
From your Ubuntu machine, open the Settings from the top right panel of your desktop.
Next, select the Devices tab:
Then select the Keyboard tab:
Scroll down to add a new keyboard shortcut:
Write a description for your keyboard shortcut and the command use the xkill command when you finish press the Add button:
You should find the newly created keyboard shortcut add at the end of the list. Now double click on the created shortcut:
Press the set shortcut button:
Enter your shortcut keys; in this example, I have used the “Alt” key and the “x” letter:
When you finish exit the opened window:
Finally, your shortcut is now enabled, and you can start using it:
Anytime you press the shortcut keys from your keyboard you should find the mouse pointer turned to a “cross” which should let you close an unresponsive application.
Method 6: Exit Software Using The System Monitor Application
In this method, we shall use the graphical interface application “System Monitor” to close the unresponsive application.
From your Ubuntu, open the Activities tab from the top left of your desktop:
Open the System Monitory application:
When the System Monitor application opens, search for the unresponsive application then right-click on it:
As you can see in the above screenshot, there are three options to choose from them:
Kill –> This the wild option where the system forces the application to close.
End –> This is the most suitable option and most appropriate way to close an application. Because first before closing the application, the system should clean the temporary files then close the application.
Stop –> This option should pause the application, and that should let you continue it later.
In case you have chosen to kill the process, a confirmation message should appear.
Method 7: Closing The Application By Clicking On The “X” Button In The Top Corner
The easiest and fastest method, here in this method you can click on the “X” button which is found in the top right corner of the application.
That’s it for now. I hope you have enjoyed this tutorial.