Overview
kill sends a signal to a process, named by its number (PID). By default the signal is TERM, which asks the process to stop and lets it clean up. -9 (KILL) stops it at once and cannot be caught. Signal 0 does not stop anything; it only checks that the process exists and that you may signal it.
Background
The kill command sends signals to processes; the Bash builtin also understands job numbers such as %1. Today the name covers the Bash builtin, the kill that macOS ships, and the kill applet in BusyBox. GNU coreutils can build a kill program too, but the Alpine and Homebrew coreutils used for these checks do not include it, so this page has no GNU view. They agree on -s SIGNAL, a numeric signal and a process number.
Examples
Start a background process, stop it with the default signal and wait for it:
{ sleep 5 & kill $!; wait $!; } 2> /dev/null; echo done
Check that a process exists without sending a real signal, using signal 0; $$ is the shell itself:
kill -0 $$ && echo alive
Name the signal with -s:
{ sleep 5 & kill -s TERM $!; wait $!; } 2> /dev/null; echo done
Use the strongest signal for a process that will not stop; the shell's own message is hidden:
{ sleep 5 & kill -9 $!; wait $!; } 2> /dev/null; echo done
Options
-s
Send the named signal, such as -s TERM, instead of the default.
-9
Send KILL, which cannot be caught or ignored.
Common mistakes
Try the default signal first: kill -9 gives the process no chance to save its work or remove its files. Check the number twice, because a wrong PID stops a different program, and a PID can be reused once a process has ended. You can signal only your own processes, unless you are an administrator. Many processes ignore TERM while busy, so a process that remains is not necessarily broken. To stop programs by name, see pkill.
Portability
Only the default signal, -0, -s NAME and -9 are in the Common examples. The list of signals printed by kill -l differs: the Bash builtin prints numbers with names, and the executables print names only. The Common examples were executed on Bash 5.2, macOS system tools, and BusyBox 1.37.0 (see the development guide for the exact check).
References
Original explanations, with upstream documentation for further reading. FreeBSD references are comparison material, not a claim of Apple version equivalence.