process

kill

Sends a signal to one or more processes. Defaults to SIGTERM, allowing a process to clean up before exiting.

kill [-SIGNAL] PID...

Common flags

Flag Purpose
-l List available signal names and numbers
-s Send a specific signal by name (e.g. -s TERM)
-9 Send SIGKILL -- cannot be caught or ignored
-15 Send SIGTERM -- the polite default
-HUP Send SIGHUP -- often used to reload configs

Examples

kill 4321

Ask PID 4321 to terminate gracefully

kill -9 4321

Force-kill a stuck process

kill -HUP $(pidof nginx)

Signal nginx to reload its configuration

kill -l

List signal names available on this system

Gotcha

SIGKILL leaves no chance for cleanup -- try SIGTERM first, then SIGKILL only if the process refuses to exit.

Related commands

← All Linux commands · Linux cheat sheet