Send a signal to a process — commonly used to terminate processes.
high risk
ps -p <pid> -o pid,ppid,user,etime,cmdConfirm what you are about to kill.kill -TERM <pid>Ask the process to stop cleanly first.kill sends signals to processes by PID. Default is SIGTERM (15) which requests graceful shutdown. SIGKILL (9) cannot be caught and forces immediate termination — use as last resort. SIGHUP (1) typically reloads service config.
| Flag | Meaning |
|---|---|
-9 -SIGKILL | Force kill immediately — no cleanup, potential data loss |
-15 -SIGTERM | Graceful termination request (default signal) |
-1 -SIGHUP | Hangup — typically reloads service configuration |
-l | List all available signal names and numbers |
kill -15 1234Gracefully terminate process 1234 (gives it time to clean up) · explain & risk-check →kill -9 $(pgrep -f stuck_process)Force-kill process by name when SIGTERM failed · explain & risk-check →kill -1 $(pgrep nginx)Send SIGHUP to nginx to reload configuration without restart · explain & risk-check →Always try SIGTERM first, wait 5s, then SIGKILL. Jumping to -9 can corrupt databases and leave stale lock files behind.
Reference text is hand-written and may be incomplete — check man kill for your version. Test destructive commands on a non-production system first.