Linuxlab

Signals and kill

Updated July 3, 2026

kill sends a process a signal by its PID. A signal is a short message from the kernel.

kill 1234          # TERM (15): exit politely
kill -9 1234       # KILL (9): remove at once, cannot be caught
kill -HUP 1234     # HUP (1): often means reload the config
pkill -x sleep     # by name, not PID

How it works: why not always -9

A process can catch TERM and exit cleanly: close files, flush buffers. KILL (-9) cannot be caught, the kernel removes the process at once, and unwritten data is lost. So -9 is a last resort.

Used in

You need this in the lesson Processes and jobs.