Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
InfrastructureMiddleOccasionalTroubleshooting

What is the difference between a normal `kill` and `kill -9` on Linux?

Answer

`kill <pid>` sends SIGTERM by default, asking the process to terminate and allowing it to run cleanup handlers. `kill -9 <pid>` sends SIGKILL, which the process cannot catch or ignore. SIGKILL is therefore a last resort after a graceful stop fails, because it can interrupt cleanup and leave external state unfinished.

Strong answer includes

  • default kill sends SIGTERM
  • SIGKILL cannot be handled by the target process
  • uses force only after graceful termination fails

Practical example

If a local test service hangs, first stop it through `systemctl stop` or `kill <pid>` and wait briefly. Use `kill -9` only when the process remains stuck and the consequences are understood.

#linux#processes#signals#kill

Sources

Linux man-pages projectman7.org / Linux man-pages project · Linux processes, signals, networking and system-call-facing command behavior50 Linux Interview Questions (With Answers)Toolmingo · Recurrence signal for Linux filesystem, permissions, processes, systemd, networking and shell-command interview topics