kill Command: Tutorial & Examples
Send a signal to a process
kill command is a utility in Linux that allows you to send a signal to a process, causing it to terminate or perform some other action. The signal can be specified using a
signal name or signal number.
Here is the basic syntax for using kill:
kill [-s signal] pid
pid argument is the process ID of the process that you want to send a signal to.
Here are some common signals that can be used with kill:
1): This signal is typically used to hang up or terminate a process that is running in the background.
2): This signal is sent when the user presses
CTRL+Con the keyboard. It is typically used to interrupt a process.
9): This signal cannot be caught or ignored, and it immediately terminates the process.
15): This signal requests that the process terminate gracefully. The process can choose to catch or ignore this signal.
18): This signal continues a stopped process.
19): This signal stops the process and cannot be caught or ignored.
To send the
SIGKILL signal to a process with a process ID of
kill -9 123
It's worth noting that only processes that the user has permission to signal can be signaled using
kill. Also, some processes may have special behavior when signaled, such as
ignoring certain signals or performing some other action in response to the signal.