Hi All,
What is difference between kill & kill -9 command?
Thanks & regards,
Sonali
Hi All,
What is difference between kill & kill -9 command?
Thanks & regards,
Sonali
type man kill
Kill is used for graceful killing where as kill -9 is unconditional. That means,
when you use -9 the program will will shut by bruteforce.
'kill' sends a SIGTERM signal to the process so it can exit cleanly(close file ptr, flush buffers, etc, and exit), 'kill -9' asks the OS to close the process. That's the only signal that is not delivered to the process,. so it can not handle.
if it is not delivered the process, how is the kernel able to terminate the process forcefully?
It is delivered.
signal handlers for -9 cannot be registered.
Along with -9 there is one more
SIGSTOP which stops the process and cannot be handled.