kill
Send a signal to a process
Overview
Sends the specified signal to the specified process or process group. If no signal is specified, the TERM signal is sent, which normally kills processes.
Syntax
kill [OPTION]... PID...
kill -l [SIGNAL_NUMBER]Common Options
-s SIGNAL, --signal SIGNALSpecify the signal to send (name or number, e.g., -9 or -KILL). Defaults to SIGTERM.
-SIGNAL_NUM or -SIGNAL_NAMESpecify signal by number (e.g., -9) or name (e.g., -TERM). This is POSIX compliant.
-l, --listList all known signal names, or convert a signal number to its name.
Common Signals:1 (SIGHUP - Hangup), 2 (SIGINT - Interrupt), 9 (SIGKILL - Kill), 15 (SIGTERM - Terminate), SIGSTOP (Stop process), SIGCONT (Continue stopped process).
Examples
Sends the default SIGTERM (15) signal to process ID 12345, requesting it to terminate.
Forcibly terminates process ID 54321 using SIGKILL.
Another way to forcibly terminate process ID 54321.
Lists all available signal names.
Prints the name of signal 15 (which is TERM).
Sends the SIGHUP signal to process ID 6789 (often to reload configuration).
Sends SIGTERM to the process ID returned by `pidof my_server`.
(Related command) Kills processes whose name matches process_name. Uses SIGTERM by default.
(Related command) Kills all processes named nginx. Uses SIGTERM by default.