Signals can be specified in three ways
Signals can be specified in three ways; they are as follows:
1. By number:
We can specify a signal using a number. For example, we have a PID `1212` and want to send a `SIGKILL` signal to kill this PID. SIGKILL has a signal number of `9` (To find signal numbers run `kill -l` command).
Syntax:
kill -9 1212
2. With SIG prefix (e.g/ -SIGkill)
We can also specify signal using SIG prefix. For example, we need to send a signal `SIGTERM` and PID is `1432`. To just check signal number of `SIGTERM` signal we can use `kill -l` command.
Syntax:
kill -SIGTERM 1432
3. Without SIG prefix:
We can also specify signals without using SIG prefix. For example, if want to send signal `TERM` and PID `1234`. To just check signal number of `TERM` signal we can use `kill -l` command.
Syntax:
kill -TERM 1234
How to Kill a Process in Linux | Kill Command
kill command in Linux (located in /bin/kill), is a built-in command which is used to terminate processes manually. kill command sends a signal to a process that terminates the process. If the user doesn’t specify any signal that is to be sent along with the kill command, then a default TERM signal is sent that terminates the process.