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

  • 0

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

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


Was this answer helpful?

« Back
Sign up for a newsletter