How to Kill an Unresponsive App in Ubuntu?

When an application freezes or becomes unresponsive in Ubuntu, you can force it to close using several command-line tools. This article covers the most effective commands for terminating stubborn processes, including kill, pkill, killall, and xkill. You will learn how to identify the problematic application, select the right command based on its Process ID (PID) or name, and safely force it to shut down.


1. Locate the Unresponsive Process

Before you can terminate an application, you often need to find its name or Process ID (PID). Ubuntu provides a couple of quick terminal tools for this:


2. The Standard kill Command

The standard kill command is used when you know the specific Process ID (PID) of the unresponsive application. By default, it sends a polite termination signal, but it can be escalated if the app refuses to close.


3. Kill by Name: pkill and killall

If you do not want to hunt down a specific PID number, you can target the application directly by its process name.

Using pkill

The pkill command looks for processes that match the name you type. It is highly flexible because it works even if you only type a partial name.

Using killall

The killall command is more precise. It kills all instances of a process, but it requires the exact, full name of the application.


4. The Graphical Shortcut: xkill

If you prefer a quick point-and-click solution without looking up names or numbers, xkill is a powerful utility for graphical applications.

  1. Open your terminal and type: xkill
  2. Your mouse cursor will transform into a crosshair or an “X” icon.
  3. Click directly on the frozen application window. The system will instantly terminate that specific GUI process.