Linux includes ‘kill,’ ‘pkill,’ and ‘killall’ commands designed to terminate processes. You can enter one or more process IDs, names, or ports for termination. This article shows how to efficiently terminate both responsive and unresponsive application processes.
Kill Command Usage Examples:
First we need to know the Process ID of a process to kill any process. Every time a program starts, automatically a unique PID is generated for that process in your Linux system. Run below command in the terminal app (ctrl+alt+t) to find the process PID first.
Here now i want to kill the gedit app. For me the gedit PID is 2185033
You can also find the PID using the correct process name like below
Kill Process Using Kill:
Now the kill the gedit process using below command.
PKill Command Usage Example:
Using Pkill command you can kill a process using the process name like below command. Open gedit app and run below command to kill it.
Killall Command Usage Example:
If a process has too many instances and child processes, then you can use killall command to kill that.
In this way you can kill a process using kill, Pkill and Killall commands.