How to force a PID to terminate?
13,000
kill -KILL $PID
or kill -9 $PID
will forcibly terminate $PID
, unless you don't have the permissions to do so (i.e., it belongs to a different user and you're not root), but be very careful with it. Inflicting it on a process will prevent it from doing any kind of filesystem (or other) cleanup.
Related videos on Youtube
Author by
voices
Updated on September 18, 2022Comments
-
voices over 1 year
Yes, I've tried all the basic
kill
,pkill
, etc. methods that come up with a Google search.
Sometimes it works, other times it seems something is preventing the process from terminating.
There is nostderr
message when thekill
command fails, butps
,pgrep
, etc. show the process is still running.Is there a more forceful way to do this? Thanks.
-
Amit24x7 almost 7 yearsTry
kill -9 <PID>
-
voices almost 7 yearsFirst thing I tried. I thought it would work too, but no such luck in this instance, unfortunately.
-
terdon almost 7 yearsOK, what happened when you tried? Did you get an error message? Nothing? What does the output of
ps
show for this process? Please edit your question and add this information. -
terdon almost 7 yearsYes, but can you please show us the output of
ps
so we can see what it reports for the process? Also, if you've triedkill -9
and that also fails, add that to your question too. The more detail you give, the more likely it is that we'll be able to answer. -
voices almost 7 years@terdon No, I can't.
-
-
EightBitTony almost 7 yearsIt's worth remembering that
kill -9
might not always stop the process in the time frame you would like - unix.stackexchange.com/questions/5642/… -
voices almost 7 yearsYep, tried that.