Processes
kill
Send a signal to a process.
processsignalstopterminatepid
Additional Notes
kill sends signals to processes. Despite the name, it does not only kill processes. It can request termination, force termination, reload configuration, pause, continue, or send other signals.
The most common workflow is to find a process ID with ps, pgrep, or top, then send a signal with kill.
Syntax
kill [signal] PID...
Parameters
PID: Process ID to signal.signal: Signal name or number. If omitted,killsendsTERM.
Common Signals
TERMor15: Ask a process to terminate gracefully. This is the default.KILLor9: Force the kernel to terminate the process. The process cannot clean up.HUPor1: Hangup. Many daemons use this to reload configuration.INTor2: Interrupt, similar to pressingCtrl+C.STOP: Pause a process.CONT: Continue a stopped process.
Examples
kill 1234
Ask process 1234 to terminate.
kill -TERM 1234
Same as the default: graceful termination request.
kill -9 1234
Force-kill a process.
kill -HUP 1234
Send hangup, often used to reload daemon configuration.
kill -STOP 1234
kill -CONT 1234
Pause and continue a process.
kill -l
List available signals.
Practical Notes
- Try normal
kill PIDbeforekill -9 PID. kill -9prevents cleanup, so temporary files, locks, or child processes may remain.- You can usually signal only your own processes unless you use
sudo. - Use
pkillorkillallwhen you want to signal by process name. - Always confirm the PID before signaling an important process.