1

This question already has an answer here:

what is the difference between kill -9 pid and kill pid command ? Do they have different behavior ? i know that -9 is for "SIGKILL" signal

marked as duplicate by muru, Byte Commander, Jacob Vlijm, Takkat, Pilot6 Jun 27 '16 at 7:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • If you don't specify a signal it will send SIGTERM (giving the process a chance to close itself down gracefully) – Zanna Jun 27 '16 at 6:47
1

kill pid (which sends signal 15 (SIGTERM)) tells pid to terminate, but said program can execute some code first or even ignore the signal. kill -9 pid, on the other hand, forces the program to immediately terminate (it cannot be ignored).

You should always try kill pid first, as it allows the program to do things like saving/closing open files before exiting. Only use kill -9 when you need the program to close and it won't respond to a simple kill pid.

Not the answer you're looking for? Browse other questions tagged or ask your own question.