Have you ever come across one of the applications on your computer ‘Not Responding’ or what we know as hanging ?. Sometimes an application that hangs makes us feel disappointed, even more so when we are in the middle of a project.
If you know how to force shutdown on the Windows Operating System, this time Yiptechid will share this method if you are using the Linux Operating System. Check out the steps below.
How to Force-kill Not Responding Programs on Linux
From a Graphical Desktop
Modern Linux desktops handle this pretty well, and are surprisingly self-contained. If an app isn’t responding, a desktop with a compositiong manager will often blacken the entire window so it doesn’t respond.
Click the X button on the titlebar of the window and the window manager will often notify you that the window is not responding. You can give it time to respond or click an option like “Force Quit” to close the app appropriately.
On Linux, the window manager that paints the title bars is separate from the application itself, so it usually responds even if the window doesn’t want to. Some windows paint their own interface, so this may not always work.
The “xkill” application can help you quickly turn off any graphical window on your desktop. Depending on your desktop environment and configuration, you may be able to activate this shortcut by pressing Ctrl + Alt + Esc. You can also run the xkill command – you can open a Terminal window, type xkill without the quotes, and press Enter. Alternatively, you can press a shortcut like Alt + F2, which opens the “Run Command” dialog on Ubuntu’s Unity desktop and many others. Type xkill into the dialogue and press Enter.
Your cursor will change to X. Click on a window and the xkill utility will determine what process is associated with that window, and then kill the process immediately. The window will immediately disappear and close.
Your Linux desktop probably has a tool that works similarly to the Task Manager on Windows too. On Ubuntu’s Unity desktop, GNOME, and other GNOME-based desktops, this is the System Monitor utility. Open the System Monitor utility to see a list of running processes – including background ones. You can also forcefully kill the process from here.
Let’s say you want to do all of this from the terminal only. We cover a lot of utilities you can use for this when we look at the commands for managing processes on Linux.
Say Firefox is running in the background and we want to kill it from the terminal. The standard kill command takes the process ID number, so you need to find it first.
For example, you can run a command like:
ps aux | grep firefox
Which will list all processes and pipe lists to the grep command, which will filter them out and print only the lines containing Firefox. (The second line you’ll see is the grep process itself.) You can also get the process IDs from the top command and many other places.
Get the process ID number from the Firefox process – just to the right of the username – and pass it to the kill command. That is, run a command like this:
If the process is running as another user, you’ll need to be the root user first – or at least run the kill command with the sudo command, like so:
sudo kill ####
That’s the basic method, but it’s not the fastest. The pgrep and pkill commands help streamline this. For example, run “pgrep firefox” to see the process IDs of running Firefox processes. You can then feed the number to the kill command.
Or, skip all that and run “pkill firefox” to kill the Firefox process without knowing the number. pkill does some template matching – it will try to find processes with names containing firefox.
The killall command is like pkill, but a little more precise. That will kill all running processes with a specific name. So running “killall firefox” will kill all running processes named “firefox,” but no processes that only have firefox in their name.
This is far from the only command included in Linux for managing processes. If you’re using some type of server administration software, it may also have a useful way of killing and restarting processes.
System services work differently from processes – you must use special commands to downgrade, restart, or open services. These specific commands may differ on different Linux distributions.
Those are the steps on how to force the ‘Not Responding’ program on Linux written by the koubou site