7 Best Ways to Kill Unresponsive Programs in Linux

For dealing with a frozen app or desktop, you can't use the CTRL+ALT+DEL in Linux system. Instead, there are powerful alternatives that come in handy in frustrating situations. We pick the best methods available for you.

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.

  1. Close software using the kill command
  2. Exit applications using the pkill command
  3. Kill applications using the killall command
  4. Kill system processes using the xkill command
  5. Creating a keyboard shortcut to kill applications
  6. Exit software using the system monitor application
  7. 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
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
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
Get The Process ID Using The pgrep Command

Now use the kill command:

kill 4401

Use The kill Command To Close The Application
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
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
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
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
Open Settings From Ubuntu

Next, select the Devices tab:

Open The Devices Tab
Open The Devices Tab

Then select the Keyboard tab:

Choose The Keyboard Tab
Choose The Keyboard Tab

Scroll down to add a new keyboard shortcut:

Scroll Down To Add A New 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
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
Shortcut Added

Press the set shortcut button:

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
Make Your Custom Shortcut Keys

When you finish exit the opened window:

Custom Shortcut Keys
Custom Shortcut Keys

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

Shortcut Added Successfully
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 Activities Tab

Open the System Monitory application:

Open The System Monitor 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
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
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
Exit Application From The Top X Button

That’s it for now. I hope you have enjoyed this tutorial.

Hend Adel
Hi! I'm Hend Adel, a freelancer technical geek with successful experience in Database, Linux and many other IT fields. I help to build solutions to suit business needs and creating streamlined processes. I love Linux and I'm here to share my skills via FOSS Linux! Thanks for reading my article.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

24,325FansLike
190FollowersFollow

LATEST ARTICLES

RECENT COMMENTS

terminate frozen app
For dealing with a frozen app or desktop, you can't use the CTRL+ALT+DEL in Linux system. Instead, there are powerful alternatives that come in handy in frustrating situations. We pick the best methods available for you.
gamemode enable linux
GameMode is a combination of various libraries and daemons that allows all the users to improve the gaming performance on the Linux system. Developed by games publisher Feral Interactive, it improves gaming performance by requesting a group of options that will be applied temporarily to the Linux system.
Uninstall Programs in Ubuntu
Uninstallation of programs can be done by graphical way using the Ubuntu Software Center, and the Synaptic Package manager. Command-line way of doing it is also possible using apt-get and aptitude commands. We shall discuss each one of them in detail.