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

Use The ps And grep Commands
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

Use The kill Command
Another way of getting the process ID is by using the command:
pgrep application_name

Get The Process ID Using The pgrep Command
Now use the kill command:
kill 4401

Use The kill Command To Close The Application
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

Use The pkill Command
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

Use The killall Command
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

Use The xkill Command To Kill Your Unresponsive Application
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.

Open Settings From Ubuntu
Next, select the Devices tab:

Open The Devices Tab
Then select the Keyboard tab:

Choose The Keyboard Tab
Scroll down to add a new keyboard shortcut:

Scroll Down To Add A New Shortcut
Write a description for your keyboard shortcut and the command use the xkill command when you finish press the Add button:

Set Shortcut
You should find the newly created keyboard shortcut add at the end of the list. Now double click on the created shortcut:

Shortcut Added
Press the set shortcut button:

Press The Set Shortcut Button
Enter your shortcut keys; in this example, I have used the “Alt” key and the “x” letter:

Make Your Custom Shortcut Keys
When you finish exit the opened window:

Custom Shortcut Keys
Finally, your shortcut is now enabled, and you can start using it:

Shortcut Added Successfully
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 Activities Tab
Open the System Monitory application:

Open The System Monitor Application
When the System Monitor application opens, search for the unresponsive application then right-click on it:

Right Click On Process Name And Kill
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.

Kill Process Confirmation Message
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.

Exit Application From The Top X Button
That’s it for now. I hope you have enjoyed this tutorial.