How to Kill a Process Running on Specific Port in Linux?

First of all, we will need to identify the Process ID which runs on any port. Once we find the Process ID, we can kill it using the kill command using PID.

Kill Process running on specific Port :

Below command will kill the process running on Port 3306.

# sudo kill -9 $(sudo lsof -t -i:3306)

Here, sudo lsof -t -i:3306 will give the PID of running process on Port 3306.

# lsof -t -i:3306
2122

Now, as per the above result 2122 is the PID of the processes running on port 3306. We can kill it using below command.

# sudo kill -9 2122

 

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to enable Analytics Feature from cPanel ?

cPanel has launched the Interface Analytics plugin in WHM version 78. cPanel Analytics plugin...

How Do I Check Bandwidth Utilization of VPS?

Windows VPS To check/monitor usage of each Windows VPS, we have installed bandwidth meter tool...

How to Stop and Disable ClamAV Service from CentOS?

We all know that ClamAV scanner is a pretty heavy on CPU-Memory resources, and it should be...

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 can I view my website before DNS changes?

Before DNS propagation takes place, you can browse your website wite temporary URL. Following are...