How to kill a process on Linux using command?

There might be an issue with applications that can be hung and not working properly. In this case, we can check the processes of the Linux system and kill the same process that is using high resources.

  1. First, let us run the top command to check which process if it is taking high CPU usage. 

  2. Find the process ID from PID for the process that is using a high amount of CPU.

  3. Now, you get the process ID. Run the below command to kill that process.

    kill – Kill a process by ID
  4. Suppose, chrome user has the PID of 11053 then we will need to run the below command.

    Kill -9 11053
  5. In case, you want to find the same process from all the users and also that are not listed in the terminal to get that process you can run the below command. 

    ps aux | grep mysql
  • a = show processes for all users
  • u = display the process’s user/owner
  • x = also show processes not attached to a terminal

       Using the ps aux | grep mysql command, you will get all the PIDs for the same process, you can run kill command and all the PIDs that will kill the process for the same service.

Related Articles

How to add IP Address on Ubuntu 18.04 using netplan?

We can configure IP Address on ubuntu 18.04 using Netplan. It is a different method to add IP...

Will internal traffic between two VPS viz. a Database Server and a Web Server be counted in my bandwidth usage?

Yes it will. The traffic will be counted in the bandwidth usage of your VPS. Even if you use...

How to setup Database Map tool from WHM Panel?

cPanel provide a feature called Database Map tool. You can provide ownership of databases and...

What is IP forwarding in Linux? How to enable IP forwarding?

IP forwarding helps you to set up the OS to work as a router. You can set IP forwarding when you...

How to install CentOS Web Panel on CentOS 7.x

This article will guide you on how to install CentOS Web Panel on CentOS 7.xCentOS web panel is...

  • 0 Users Found This Useful

Was this answer helpful?