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 Configure Redis Caching to Speed Up WordPress on Ubuntu 18.04?

Redis is an open-source in-memory data structure store. It can be used as a DB and cache. It...

How to Install Joomla from Softaculous in cPanel?

Joomla is an open-source and a popular CMS. It is a very easy process to build a joomla template....

How to disable anonymous ftp in cpnael?

Note : It is not recommended to use anonymous FTP. It allows any person to access FTP without...

Do you offer apache web service with controlpanel option?

Yes, we do offer apache web service with controlpanel like cPanel and Plesk. Both of these...

How to check Various cPanel logs like WHM, Apache, MySQL, Email, Error etc?

You can use cPanel to access your Linux hosting account with GUI. It is relatively easier to work...

  • 0 Users Found This Useful

Was this answer helpful?