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

23,417FansLike
377FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

Basics of Working with the SQLite Database in Python

A database is one of the most useful and popular files for storing data; they can be used to store any kind of data, including text, numbers, images, binary data, files, etc. SQLite is a relational database management system based on the SQL language. It is a C library, and it provides an API to work with other programming languages, including Python. It does not require a separate server process to be run as needed in large database engines like MySQL and Postgresql.

5 Ways to Check the Linux Version

When most people talk of Linux, they are always referring to a Linux distribution. However, this is not the case. Linux itself is a kernel which acts as a bridge between user applications and the hardware. When we talk of a Linux distribution, we refer to an operating system developed from the Linux kernel. A distribution comes with a package manager, pre-installed applications, a Desktop Environment, and several more features.

Getting Started with Linux Operating System

The Linux operating system brings forth a vibrant mix of features and security, making it the best alternative to macOS or Windows operating systems. In this post, we will give you a master guide on Getting started with Linux systems - taking you from a complete beginner to a level where you can begin testing the various Linux distributions available with much ease.

How to Create a Comprehensive Mail Server on Ubuntu

Postal is a free and open-source mail server used to send and receive emails. It comes loaded with tons of excellent features and functionalities, making it extremely popular among large organizations as well as in enterprise settings.

The 10 Best Linux Performance Monitoring Tools

Do you want to monitor the performance of your Linux system? Are you looking for some powerful performance monitoring tools to help you out? If you agree, it's your day as we have put together a detailed list of the ten best Linux performance monitoring tools.

How to Boot your Windows or Linux PC from a USB Drive

Sometime back, the process of installing an operating system required users to pop a bootable media disk into their DVD or CD drive and use it to boot the PC. But times have changed. Nowadays, the most common way of installing an OS is booting from a USB drive. The use of USB drives is further propelled by the current production of slim and lightweight laptops with no support for DVD/CD drives.

MUST READ

Buyers who wish to go for a machine that is based on Linux often show interest in Chromebooks due to the form factor and extended battery life capabilities. Although ChromeOS power these machines, users can still miss out on a more genuine Linux experience. For those who happen to agree, the new Lemur Pro by System76 might get some heads turning.
Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.

Getting Started with Linux Operating System

The Linux operating system brings forth a vibrant mix of features and security, making it the best alternative to macOS or Windows operating systems. In this post, we will give you a master guide on Getting started with Linux systems - taking you from a complete beginner to a level where you can begin testing the various Linux distributions available with much ease.

All about Ubuntu editions and which version should you use?

Ubuntu is one of the most popular Linux distributions developed and released by Canonical, and not without reason. It has very enriched repositories, with support for all the programs you could ever need.

Guide to watching Disney+ on Linux

Disney Plus or Disney+ is an on-demand entertainment streaming service in which you should see the content produced by Disney Studios, Star Wars, Marvel, Pixar, and National Geographic. The service was launched on the 12th of November 2019.

6 Best Linux Distros for Programmers and Developers

Linux distros have long been a favorite among programmers since the rise in popularity of the OS in the nineties. Programmers are technical by nature, and Linux distros appeal to that technical nature. Let's discuss why Linux is a great desktop OS for programmers and developers, and find out best distros suitable for them.