Kill is misnamed
kill doesn't always kill — it sends a signal. Different signals tell the process different things; the default is SIGTERM ("please shut down"). Programs that handle signals can clean up. The nuclear option, SIGKILL, can't be caught.
The signals you'll use
kill PID— same askill -TERM. Default. Polite shutdown.kill -INT PID— SIGINT. Same as Ctrl+C.kill -HUP PID— SIGHUP. Many daemons treat this as "reload your config" without restarting.kill -USR1 PID— application-defined. nginx uses it for log rotation, for example.kill -KILL PIDorkill -9 PID— SIGKILL. Force kill, no cleanup. Last resort.kill -STOP PID/-CONT— pause and resume (like Ctrl+Z thenfg).
kill by name
pkill firefox
pkill -f 'python myscript.py' # match full command
killall Slack # macOS GUI appsThe escalation ladder
kill PID— politely.- Wait 5–10 seconds. Most well-behaved programs exit by now.
kill -KILL PID— only if SIGTERM was ignored.
Reaching for -9 immediately is a bad habit; the program can't flush buffers, close files, or release locks. Save it for wedged-process emergencies.