7 Different Ways To Kill Unresponsive Programs in Linux

Linux software is typically robust enough to work without causing any problems, but from time to time, eventhe best apps The Best Linux Software The Best Linux Software Linux is full of awesome apps, both open source and proprietary. People new to Linux and even seasoned Linux users tend to find new and useful software quite often. Here’s what we love. Read More might hang. Rather than wait for them to crash, you can kill these unresponsive programs. In fact, there are so many ways to kill them that you might find you’re spoiled for choice!

If you’re experiencing problems with an application in Linux, here are seven ways to kill unresponsive software.

1. Click the X in the Corner

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? Well, at this stage, you can try clicking the X button in the top corner (left or right, depending on your Linux operating system The Best Linux Distributions The Best Linux Distributions There are many Linux distributions available for a number of different purposes, which makes it difficult to choose at times. Here’s a list of the very best to help you decide. Read More ). This should stop the program dead in its tracks. You might also see a dialog box, asking you to either Wait for the program to respond or Force Quit to end it now.

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


Either way, the application should have stopped running. But what if it hasn’t…?

2. System Monitor

The next option is to open your Linux operating system’s System Monitor utility, much like theWindows Task Manager How To Handle Suspicious Windows Task Manager Processes How To Handle Suspicious Windows Task Manager Processes CTRL + ALT + DEL aka three-finger salute is the quickest way to add to your confusion. Sorting through Task Manager Processes, you may notice something like svchost.exe using 99% of your CPU. So now… Read More . This is typically found in the System Tools menu, and once launched will display 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 jump to the command that you know works.

3. Close Linux Apps with “xkill”

Another option you can employ is xkill. This is preinstalled in Ubuntu, but you can install it via the Terminal (which you can open with CTRL + ALT + T ) if necessary. When called, xkill will enable you to close any desktop app. Install it with the following command:

sudo apt-get install xorg-xkill

Once this is done, run xkill by simply typing


Your mouse pointer will then display a cross (or a skull), and all you need to do is left-click on the offending application.

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. (With some distros, CTRL + ALT + F1 will open a virtual terminal — you can switch back to the desktop with CTRL + ALT + F7 .)

Several command line options are available to help you to close your app. Better still, these can be used either on your computer or byconnecting over SSH Beginner’s Guide To Setting Up SSH On Linux And Testing Your Setup Beginner’s Guide To Setting Up SSH On Linux And Testing Your Setup Arguably one of the most important Linux utilities to learn is SSH as you can control a different machine as if you were sitting directly at it. We’ll take you through a basic installation. Read More 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.

5. Use “pkill” and “pgrep” to Kill Unresponsive Software

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]

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 particular 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 Keyboard Shortcut

If you want to save time closing unresponsive software — perhaps you have some regular offenders — then the best option is to create a keyboard shortcut. This will give you the immediate option to close an app, but you’ll need to have xkill installed for this to work.

In Ubuntu, for example, you can open Settings > Keyboard and click on Shortcuts . Select Custom Shortcuts , then + to create a new shortcut. Input “xkill” for both Name and Command , then click 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.

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.

If switching to a lightweight Linux operating system 13 Lightweight Linux Distributions to Give Your Old PC a New Lease of Life 13 Lightweight Linux Distributions to Give Your Old PC a New Lease of Life Read More doesn’t work, you might consider some hardware upgrades. 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.

It’s surprising that there are so many ways to kill unresponsive Linux apps — but what’s your favorite? Share it with us in the comments box.

MakeUseOf稿源:MakeUseOf (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 科技动态 » 7 Different Ways To Kill Unresponsive Programs in Linux

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录