What's the correct way of killing a frozen application in Linux?
Friday, April 9th, 2010 at
14:35
1) kill PID
2) xkill, click the windows.
3) kill -9 PID
All work but what’s the standard/safest or your preferred way of doing this?
What’s the difference between kill PID, kill -9 PID and
kill -KILL PID ?
Filed under: Linux Applications
Like this post? Subscribe to my RSS feed and get loads more!
kill PID
In this case the termination signal SIGTERM is sent to the process PID. If the process is still alive it will get this signal and unless programmed to do something else (some process might ignore this signal) it will terminate.
killl -9 PID
In this case the signal SIGKILL can NOT be intercepted by the PID and goes directly to the parent process of PID which will terminate PID.
xkill is more like a "kill -9" command. We are telling to the Xserver to close connection with the client, thus killing the client.
So kill PID would be the safest since it is the process PID which will terminate itself. However if this process is "frozen" it will not respond anymore so a "kill -9" is required or xkill if it is an application with a GUI.
ctrl alt esc
kill PID
They all work indeed, and they all do the same command. The xkill not only kills the process, but makes sure the window is removed as well, from what I understand. Just because you kill a process doesn’t mean that the xserver knows to remove the window.
I like adding the Force Quit button on a panel in the Gnome interface. It works wonderfully.
Just kill PID
if the process was written to catch SIGTERM then you will need to use
kill -SIGTERM PID