Today we will learn about Linux Kill Command. Despite being the most versatile operating system, Linux sometimes faces some application bugs that affect system performance. These applications become unresponsive to any activity, it is necessary to kill or terminate the running application or process to restore the proper functioning of the application. To solve this purpose, Linux provides the “kill” command.
This article will focus on the “kill” command and the various options that can be used with this command.
Linux Kill Command
The “kill” command is available with several shell built-ins. Command syntax may vary between different shells. To check the location of the kill command in your shell, you can hit the “type” command as shown below.
type -a kill
with examples.
Syntax-
kill [OPTIONS] [PID]…
Where-
signal number: a non-negative decimal integer.
signal name: it is a symbolic signal name.
PID: displays the entire list of processes.
For getting the list of all the available signals, you can hit the “kill” command along with the “-l” option, as shown below.
kill -l

You can specify the signal in three different ways as per your requirement-
- number (eg, -1 or -s 1).
- with the “SIG” prefix (eg, SIGHUP).
- Without the “SIG” prefix (eg, HUP).
The following commands can be used interchangeably, as they all perform the same action.
- kill -1 PID_NUMBER
- kill -SIGHUP PID_NUMBER
- kill -HUP PID_NUMBER
PID > 0, this command will send a signal to be processed with the specified PID.
PID=0, this command will signal all processes present in the current process group, i.e., same GID.
PID = -1, this command will send signals to all processes that have the same UID as the user using the “kill” command. If the specified user is the root user, the signal will be sent to all processes except the init and kill processes.
PID < -1, this command will send signals to all available processes in process group eq with GID equal to the absolute value of PID.
If you are a regular user other than root, you are only allowed to send signals to their own processes, not even to other user processes.
Different values for signal number and signal name
| Signal Number | Signal Name (short name) |
| 0 | SIGNULL (NULL) |
| 1 | SIGHUP (HUP) |
| 2 | SIGINT (INT) |
| 3 | SIGQUIT (QUIT) |
| 9 | SIGKILL (KILL) |
| 15 | SIGTERM (TERM) |
| 24 | SIGSTOP (STOP) |
| 25 | SIGTSTP (STP) |
| 26 | SIGCONT (CONT) |
Killing a process using the “kill” command
To kill a process, you can simply use the kill command. But, since each process has a different PID, you need to specify the process ID number (PID) to identify the specific process among all.
ps

pid

Now, you have the PID of the “settime” process as “55” which you can specify with the “kill” command to kill the specific process, as shown below.
kill -9 55.
This command will kill the “set time” process.
Reload process using the kill command
You can also use the ‘kill’ command to send the necessary HUP signal which will help reload the processes settings.
Another way to use the kill command is to send the HUP signal, which tells the process to reload its settings. In the example below, we have reloaded the process with process ID-38 (bioset), as shown below.
![]()
Make sure to run the above command with sudo privilege.
Conclusion
Whenever a process or application starts to malfunction or become unresponsive to your actions, you have the option to manually or force stop that process. Linux offers a simple command “kill” to do this. We have explained how this command works with different options. If you need Linux Server then you can buy it from oudel inc. Learn more about Rocky Linux here.



