7 Ways to Kill Unresponsive Programs in Linux

Christian Cawley Updated 09-12-2019

Linux software is robust enough to work without causing problems, but sometimes even the best apps might hang. Rather than wait for them to crash, you can kill these unresponsive programs. In fact, there are so many ways to kill Linux programs that you might find you’re spoiled for choice!


If you’re experiencing problems with an application in Linux, here are several ways to kill a program in Linux.

1. Kill a Linux Program by Clicking the “X”

Simply close an app in Linux

You’ve probably already tried walking away and making a hot drink. If you returned to your PC to find that the app is still hanging, it’s probably had enough time to start working again. An unresponsive app typically has grayed-out buttons, or options that don’t appear to work. You may also be unable to move the app window around the screen.

So, what is the solution? Click the X button in the top corner (left or right, depending on your Linux operating system). This should stop the program dead in its tracks. You might see a dialog box, asking you to Wait or Force Quit to end it now.

If all goes to plan, some distros will prompt you to send an error report.


2. Use System Monitor to Kill a Linux Process

Kill a Linux process in the system monitor tool

The next option is to open your Linux operating system’s System Monitor utility. This is typically found in the System Tools menu and displays a list of running processes under the Processes tab.

To close an unresponsive application here, simply select it and right-click. You then have three options:

  • Stop Process: This pauses the process, letting you continue it later. It won’t work in most cases.
  • End Process: The correct way to close a process, this will safely terminate the application, cleaning temporary files on the way.
  • Kill Process: This is the extreme option and should only be used if End Process fails.

It’s best to use these in order. However, if the application is one that hangs regularly, you might prefer to use a command that you know works.


3. Force Kill Linux Processes With “xkill”

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

sudo apt install xorg-xkill

Once this is done, run xkill by simply typing


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

If it’s not possible to close your unresponsive app with any of these desktop-focused methods, the solution might be the command line…


4. Use the “kill” Command

If your app is unresponsive and the above suggestions don’t work (the GUI might be unresponsive), hit Ctrl + Alt + T to open the Terminal.

Several command line options are available to help you to close your app. Better still, these can be used either on your computer or by connecting over SSH from another device.

The kill command can be used here, but first requires a process ID. You can find this by running a command interrogating the application for its process ID:

ps aux | grep [process name]

The result will display the process ID. This can then be used as follows:

kill [process ID]

Note that you may need to append the command with sudo.

Close Linux apps with the Kill command

5. Use “pgrep” and “pkill”

What if you don’t know, or cannot find, the process ID? This is where the pkill command comes in. Rather than a process ID, simply 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 following this, use pkill with the process ID.

pkill [process ID]

Kill a Linux app with the pkill command

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

6. Kill All Instances With “killall”

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

Fortunately, it isn’t as devastating as it might be. The killall command will end all instances of a specified program. So, rather than killing one Firefox window, the following command will end them all:

killall firefox

All you need is the process name and the killall command (possibly with sudo if demanded by your setup).

killall [process name]

Naturally, you should only use this command when needed. It’s unsuitable for most unresponsive program situations.

7. Create a Force-Kill Keyboard Shortcut

Want to save time closing unresponsive software? The best option is to create a keyboard shortcut. This will give you the immediate option to close an app, but it requires xkill for this to work.

In Ubuntu, open Settings > Keyboard and click on Shortcuts. Select Custom Shortcuts, then + to create a new shortcut. Input “xkill” for both Name and Command, then Apply. This will return you to the shortcuts list—select the shortcut, then press the required keyboard combination that you will use to call it.

Create a shortcut to kill unresponsive apps

Next time you need to close an app, just use the keyboard shortcut. The mouse pointer will become an X, and you can click anywhere on the app you want to close.

Avoid Unresponsive Software: Upgrade Your Hardware

Are unresponsive applications regularly causing problems? You could probably benefit from making some changes to your Linux computer.

Installing additional RAM is the number one way to give your computer more power and might be just the thing you need to keep those temperamental apps from becoming unresponsive in future.

So, the next time a Linux application or utility hangs and becomes unresponsive, all you need to do is apply one of these solutions:

  1. Click the X in the corner.
  2. Use the System Monitor.
  3. Use the xkill app.
  4. Employ the kill command.
  5. Close apps with pkill.
  6. Use killall to close software.
  7. Create a keyboard shortcut.

If none of these solutions works and you’re regularly experiencing unresponsive Linux apps, consider switching to a lightweight Linux operating system 14 Lightweight Linux Distributions to Give Your Old PC New Life Need a lightweight operating system? These special Linux distros can run on older PCs, some with as little as 100MB of RAM. Read More .

Related topics: Linux Tips, Task Management, Tech Support, Troubleshooting.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Jim
    May 15, 2019 at 10:44 am

    Thanks, I never use keyboard shortcuts, but just set one up for "xkill'. Seem really useful for when the screen locks up.

  2. Debbie
    May 30, 2017 at 2:16 pm

    Lately I have been having an issue which I think might be caused by a sticky key on my keyboard, which is not exactly unresponsiveness, but makes the GUI unusable. I will try to open an application, but instead of starting a single instance, more and more windows will keep opening faster than I can possibly close them. Killing them each individually does not work, because several more will open in the time it takes to kill one. I think Ctrl-Alt-F1, top, and pkill ought to do the trick. Thanks for the great article.

  3. fbfhn
    April 29, 2016 at 10:42 am

    i still don't understand how can we use the top command with ps and kill to see if a computer is misbheaving

  4. matin
    December 5, 2015 at 4:18 pm

    wow niceeeeeeeeeeeeeeeeeeee

  5. rain
    January 8, 2010 at 6:53 pm

    wow it's so nice to know those i know how powerful Linux is

  6. ewqtrwerw
    December 21, 2009 at 11:27 am

    Another amazing utility is top and its variants. Simply run top, look for your process and finaly hit kyy k (K) (and specify a number of the process).

  7. khinch
    December 20, 2009 at 2:36 pm

    I haven't seen any mention of the "ALT+SYSRQ" combinations so far.

    Even when a misbehaving app locks out your keyboard, the kernel will still respond when "ALT+SYSRQ" are pressed together. (On some keyboards SysRq is labelled as "Print screen", on others it's labelled on its own).

    99% of the time when a Linux system won't respond to any of the above, you can safely reboot by holding down ALT + SysRq and then R,E,I,S,U,B, leaving a quick pause between each key for the system to respond. You can easily remember that combo because it is BUSIER backwards.

    This has saved me a few times when I have been mincing around with some settings I probably shouldn't have!

  8. Einheit
    December 20, 2009 at 1:08 pm

    Might be good to try kill -2 (SIGINT), before kill -9, since that has the possibility of causing problems.

  9. bhagya
    December 17, 2009 at 10:54 pm

    I was using 'wammu' lately, when suddenly my comp froze.. The mouse pointer froze.. and the 'caps-lock' light started turning on and off... I couldn't even switch to the command line mode then... Nor could do anything with the frozen GUI...

    Any suggestions, how to handle such situations except rebooting...?

    • Felix
      December 21, 2009 at 1:52 am

      Blinking keyboard LEDs are an indication for Kernel panic. You're out of luck in this situation. After reboot, you might want to check the system logs for possible causes.

  10. kevin
    December 17, 2009 at 8:31 pm

    This is a good article. I do not use very powerful computers and they seem to lock up sometimes. It seems to happen more often lately. I use Ubuntu with firefox. When i have more than a couple applications running with firefox,things slow down and, I get frozen mouse and screen. I usually shut down the system and then reboot. It doesn't seem to affect anything but my time and patience. I recently loaded the latest ubuntu 9.something and I've already gotten a couple of freezeups. I will save this article and try some of the suggestions.

  11. reup
    December 17, 2009 at 5:31 pm

    for users with compiz(-fusion) the esc key cannot be used as shortkey, you need to change the xkill shortcut from CTRL-ALT-ESC to something like CTRL-ALT-end (that what I choose) in the ccsm (compiz control system manager ?)

    I would like to redirect some of you to this great article that explain how to save yourselves from a kernel lock using the otherwise useless key sys-rq and Tricks/sysrq.htm

  12. Dennis Murczak
    December 17, 2009 at 8:26 am

    In KDE, you can bring up a process list using CTRL-ESC and kill (or renice) the process from there. xkill is bound to CTRL-ALT-ESC. Or just click on the close button of the unresponsive window and wait a few seconds.

    If Plasma crashes and isn't restarted automatically, you can usually still bring up krunner via ALT-F2. Else, go to a fullscreen VT and run killall X to re-login.

  13. GB
    December 17, 2009 at 6:47 am

    Since I started to play with Google Chrome on Linux, I regularly see Chrome starting to do ridiculous amounts of I/O for no good reason that I can fathom. The keyboard and mouse become unresponsive as the kernel struggles to handle the load. The only reliable way I have found to kill it is to ssh in from another computer and issue "pkill chrome".

    I wonder would I would do (other than a hard restart of the whole computer) to restore normality without a second computer to use.

  14. PBhat
    December 17, 2009 at 3:14 am

    While Windows 'blue screen of death' is much maligned in the Linux world,the linux 'busy screen of death' is no less malignant.While unresponsive programs in Windows do not seem to touch keyboard and/or mouse,the first thing that happens in linux in a race or lock conditions is the death of keyboard/mouse.
    The core OS and Shell may all be in good shape,but when keyboard/mouse are dead,all that you have described is no use.I have many times experienced that.The remote options are not available to ordinary user.
    The linux kernel is happy about letting an application take over entire system,it seems.Throw a tiff file with multiple pages and try to open it,the system goes into a spin of no return.None of these options are open then.

    • Jahm Mitt
      December 17, 2009 at 10:01 pm

      Ohhhh Ha Ha Ha

      "While Windows ‘blue screen of death’ is much maligned in the Linux world,the linux ‘busy screen of death’ is no less malignant"......

      Yeah FIREFOX gets into MEMORY LEAKS and SYSTEM HOGGING like a battleship in a bathtub....


      • PBhat
        December 19, 2009 at 8:52 pm

        To read care-FULLY and understand is the biggest service you can do to Linux or whatever else.Thank you.

  15. banjo
    December 17, 2009 at 2:58 am

    I run Mint Gloria version. Very often when i try to type in a URL firfox freezes to the point where the GUI , mouse , key board becomes unresponsive. I have tried Ctrl Alt Backspace, Ctrl Alt B, etc to no effect . Usually I have to power down and restart. Any suggestions???????

  16. willmake
    December 16, 2009 at 2:29 pm

    The worst trouble about unresponsive programs happen when they also block the keyboard and mouse, making it impossible to enter commands. Then the only solution is an hardware reset witch may cause data loss and/or file corruption.

  17. James D
    December 16, 2009 at 2:27 pm

    And there's the intermediate stage between the GUI and pkill: htop, everyone's favorite curses application.

  18. Unixpert
    December 16, 2009 at 10:27 am

    I've never had a system lock up to the point where I've lost the GUI, but I've had several applications lock. Mostly Firefox alphas and ALWAYS K3B & Devede during the Ubuntu alpha phase. My favorite way of dealing with them is simply gnome-do +xkill. alt-F2/Krunner works too, but I find the whole "alt-F2" key command difficult to hit. Superkey+space is so much easier.

  19. neil
    December 16, 2009 at 3:52 am

    Often it is full screen games that go bad and lock out the keyboard. For that I ssh in and just do kill the offending app via the shell. Of course, this way is no use if you are not running ssh and do not have a second computer handy.

    • Bodo
      December 17, 2009 at 2:17 am

      If you don't have a computer handy (presuming you do have ssh installed on your pc) you can also use a Nokia or other S60 device with PuTTY installed to ssh in ;-)

  20. Rioting_pacifist
    December 15, 2009 at 9:48 am

    I find htop to be a good tool to use from the command line

    Also note that killall does kill everything on other operating systems so it's better to get used to using pkill to avoid using killall on solaris by mistake.

  21. Jude
    December 14, 2009 at 10:30 pm

    If it's something that's eating up all my memory or CPU cycles, I always use top, and then k (kill inside top) and then enter the pid of the errant application.

  22. Ikai Lan
    December 14, 2009 at 4:56 pm

    Don't leave out switching your TTY if a single app blocks your entire GUI and you can't pull upa terminal window or the process monitor:

    Control-Alt-F1/2/3/4/5/6, killall -9 java, Control-Alt-F7 to go back to your Window manager.

    • Ikai Lan
      December 14, 2009 at 4:57 pm

      D'oh, it is in there. Never mind.

  23. Benny the Irish polyglot
    December 14, 2009 at 3:39 pm

    Surprised to not see the absolute easiest option of all for those of us who prefer the GUI. Right click the panel click "add to panel" then "Force Quit". From now on, you are just just two clicks to killing any unresponsive app (presuming it occupies a clickable window). I imagine this uses the xkill command you mentioned, but two clicks is quicker :)

    • Even Easier
      December 16, 2009 at 2:21 pm

      In most Linux GUIs, just press toghether Ctrl-Alt-Esc to get a killing mouse pointer (just like xkill, but easier).

      If you change your mind, just press Esc to abort killing and revert to a normal pointer.