How to kill unresponsive programs in Linux

Although Linux software often causes fewer problems when operating, there are times when the best application also crashes. This article will show you some ways to kill unresponsive programs in Linux.

Although Linux software often causes fewer problems when operating, there are times when the best application also crashes. Instead of waiting for them to respond, you can exit these programs. This article will show you some ways to "kill" unresponsive programs in Linux.

How to close unresponsive programs in Linux

  1. 1. Close the unresponsive program by clicking the X button
  2. 2. Use System Monitor to close the Linux process
  3. 3. Exit Linux processes with xkill
  4. 4. Use the kill command
  5. 5. Use pgrep and pkill commands
  6. 6. Close all instances of an unresponsive program with killall
  7. 7. Create a shortcut to close the unresponsive program

1. Close the unresponsive program by clicking the X button

The buttons on the unresponsive application are usually gray or the options are not available. You can't even move the application window around the screen.

How to kill unresponsive programs in Linux Picture 1How to kill unresponsive programs in Linux Picture 1

So what's the solution? Click on the X button in the top corner (left or right depending on the Linux operating system you are using). This will bring up a dialog box, asking you to Wait or Force Quit to end the program. Some distributions require you to submit an error report.

2. Use System Monitor to close the Linux process

How to kill unresponsive programs in Linux Picture 2How to kill unresponsive programs in Linux Picture 2

The next option is to use the System Monitor utility of the Linux operating system. You can find this tool in the System Tools menu and display a list of running processes in the Processes tab.

To close unresponsive applications, select it and right-click. You will have three options:

  1. Stop Process : Pause the process so you can continue it later. However, this option does not always work well.
  2. End Process : This is the correct way to close a process. This option will turn off the application safely, erasing temporary files.
  3. Kill Process : This option is not recommended, only when the End Process option is unavailable.

3. Exit Linux processes with xkill

Another option you can use to close unresponsive programs is xkill. This is a built-in Ubuntu tool used to force closed unresponsive programs. If you don't use Ubuntu, you can install it via Terminal.

Xkill can close any computer process. To install xkill, use the following command:

 sudo apt install xorg-xkill 

Then run xkill with the command:

 xkill 

Your cursor will display an X, left-click the unresponsive application to close it.

4. Use the kill command

If the above measures cannot close your unresponsive application, press C trl + Alt + T to open Terminal.

There are several command line options that can help you close these applications. You can use them on your computer or connect via SSH from another device.

To close unresponsive programs, we will use the kill command, but a process ID is required. You can find this ID by running the following command:

 ps aux | grep [process name] 

Replace process name with the process name you want to close. After having a process ID, use the following command:

 kill [process ID] 

Replace process ID with the ID you just found in the above command.

Note: You may need to use the command with sudo.

How to kill unresponsive programs in Linux Picture 3How to kill unresponsive programs in Linux Picture 3

5. Use pgrep and pkill commands

If no process ID is found, you often switch to using the pkill command. This command does not require an ID, only 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 ID found in the above command.

 pkill [process ID] 

How to kill unresponsive programs in Linux Picture 4How to kill unresponsive programs in Linux Picture 4

As with the kill command, this operation will close the process within about 5 seconds.

6. Close all instances of an unresponsive program with killall

If kill and pkill cannot close your unresponsive application, it's time to use killall .

The killall command will close all instances of a specific program. For example, instead of just closing a Firefox window, it will close all windows of this program.

 killall firefox 

This method is very simple, you only need the process name and the killall command (can be used with sudo if necessary).

 killall [process name] 

However, you should only use this command when necessary because it is not suitable for most unresponsive situations.

7. Create a shortcut to close the unresponsive program

Want to save time closing unresponsive software? The best option is to create a shortcut to immediately close an application. However this option requires xkill use.

In Ubuntu, open Settings> Keyboard and click on Shortcuts , select Custom Shortcuts , then click + to create a new shortcut. Enter xkill for both Name and Command sections, then click Apply . You will see a list of shortcuts, select shortcuts and then press the key combination required to use when closing the unresponsive program.

How to kill unresponsive programs in Linux Picture 5How to kill unresponsive programs in Linux Picture 5

The next time a program is not responding, simply press the shortcut created above. The mouse pointer will turn into an X and you can click anywhere on the application to close it.

Frequently unresponsive applications cause problems? You should perform an upgrade of your computer's RAM.

If none of these solutions work and programs on Linux are often unresponsive, consider switching to a lightweight Linux operating system.

I wish you all success!

4.4 ★ | 11 Vote