How to Kill Process in Linux

In this tutorial, we will guide you on how to kill a process in Linux. On your computer system, you may have several processes running in the background. Some might be active while the others might be in sleeping mode (inactive). You might want to kill a specific process in linux because it might be wasting too many system resources. In this tutorial, we will teach you how to kill a process in linux by using the terminal application.

Step 1 – View process tree in terminal
First of all, open the terminal. With the terminal application opened up, let’s view the entire process tree. In order to do so, type in the “pstree” command and hit the enter key.
See the processes in terminal

Step 2 – Use the top command
With that done, let’s use the “top” command to see the top running process along with their process ID.
Top Command

Step 3 – Linux “kill process” command
To kill a process, you will first have to note down the process id. The process id is important for the linux kill command. For example, we might want to kill the gnome-terminal process. The linux kill command for the gnome-terminal process would be “kill 7381”. Type it in and then hit the enter key.
This will automatically kill the process and close the terminal application.
Kill process command in linux