7 ways to kill unresponsive programs in Linux

Linux software is reliable enough to run smoothly, but sometimes even the best applications can freeze. Instead of waiting for them to crash, you can kill those unresponsive programs. In fact, there are so many ways to kill Linux programs that you might be spoiled for choice!

If you are having problems with an application on Linux, here are some ways to kill the program on Linux.

1. Quit the Linux program by clicking “X”

You’ve probably already tried to leave and make a hot drink. If you went back to your computer and found that the application was still freezing, it had enough time to recover. An unresponsive app usually has grayed out buttons or options that don’t work. You may also not be able to move the application window around the screen.

So what’s the solution?

Just click the X button in the upper corner (left or right, depending on your Linux operating system). This should stop the program. You may see a dialog asking you to wait or force quit now.

If all goes to plan, some distributions will ask you to submit a bug report.

2. How to kill a program in Linux using the system monitor

The next option is to open the System Monitor utility for your Linux operating system.

To find this:

  1. Open Apps for Shows
  2. Scroll to Utilities
  3. Select System Monitor

System Monitor displays a list of running processes in the Processes tab .

To kill an unresponsive program here, just select it and right click. Then you have three options that you should try in the following order:

  • Stop:This pauses the process, allowing you to resume it later. In most cases, this will not work.
  • End: Thecorrect way to close the process, this will safely shutdown the application by clearing out temporary files along the way.
  • Kill:This is a last resort and should only be used if the process fails.

It is best to use them in order. However, if the application freezes regularly, you may prefer to use a command that you know works.

3. Force terminate Linux application processes with “xkill”

Another option you can use is xkill.

It is a force kill tool preinstalled in Ubuntu, but you can install it via Terminal on other distributions if needed. When called, xkill will allow you to close any desktop process. Install it with the following command:

sudo apt install xorg-xkill

Once that’s done, run xkill by simply typing

xkill

The mouse pointer will then display a cross (or skull). Left-click on the problematic application to close it.

4. Force quit Linux applications using the “kill” command.

Can’t close an unresponsive app using the desktop tool? The solution might be a tool that forcibly closes Linux applications on the command line.

Several command line options are available to help you close the application. Moreover, they can be used either on your computer or when connecting via SSH from another device.

The kill command can be used here, but the process ID is required first. You can find this by running a command asking the application for a process ID:

ps aux | grep [process name]

This will display the process ID. Then it can be used like this:

kill [process ID]

Note that you may need to add the command using sudo.

5. Use the “pgrep” and “pkill” Linux force exit commands.

What if you don’t know or can’t find the process ID? This is where the pkill command comes in. Instead of a process id, just use pkill along with the process name:

pkill [process name]

Alternatively, you can use the pgrep command to find the process ID:

pgrep [process name]

… And then use pkill with the process id.

pkill [process ID]

As with the kill command, this should kill the process within about 5 seconds.

6. Force kill all Linux instances with killall

Bad luck with kill or pkill? It’s time to use the nuclear option: killall.

Fortunately, this is not as bad as it could be. The killall command will terminate all instances of the specified program. So, instead of closing one Firefox (or other Linux browser ) window , the following command will terminate them all:

killall firefox

All you need is the process name and the killall command (possibly with sudo if your installation requires it).

killall [process name]

Naturally, you should only use this command when necessary. This is not suitable for most situations where the program is not responding.

7. Force termination of the process in Linux using a keyboard shortcut

Want to save time by closing unresponsive software? The best option is to create a keyboard shortcut. This will give you an immediate option to close the application, but this requires xkill. This is how it works in Ubuntu:

  1. Open Settings> Keyboard shortcuts.
  2. Scroll down and click +to create a new shortcut.
  3. In the Nameand Command fields , enter “xkill”.
  4. Click Shortcutto define a keyboard shortcut for invoking a command.
  5. Click Addto finish

To use the shortcut when the application freezes, just use the keyboard shortcut. The mouse pointer will change to an X and you can click anywhere in the application you want to close.

Linux killing apps on a regular basis? Upgrade your hardware

Are unresponsive apps regularly causing problems? You might find it helpful to make some changes to your Linux computer.

Installing extra RAM is the number one way to increase the power of your computer, and perhaps exactly what you need to keep these temperamental apps from becoming unresponsive in the future.

Now you know how to terminate a program in Linux

So, the next time a Linux application or utility freezes and becomes unresponsive, all you have to do is apply one of the following solutions:

  1. Click the X in the corner
  2. Use system monitor
  3. Use the xkill app
  4. Use the kill command
  5. Close Linux applications with pkill
  6. Use killall to close software
  7. Create a keyboard shortcut to automate uninstalling an app on Linux

If you regularly experience freezing Linux applications, why not consider upgrading to a lightweight Linux operating system?

by Abdullah Sam
I’m a teacher, researcher and writer. I write about study subjects to improve the learning of college and university students. I write top Quality study notes Mostly, Tech, Games, Education, And Solutions/Tips and Tricks. I am a person who helps students to acquire knowledge, competence or virtue.

Leave a Comment