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

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 install the Zabbix agent version 3.0 on Debian 9 (strech)?

Zabbix is an Open-source monitoring tool use to monitor the health of servers, networks and other...

How to Install OpenJDK JAVA 11/8 on Ubuntu?

You can follow this tutorial to install JAVA OpenJDK in all the Ubuntu versions. Following are...

Is it possible to take complete VPS backup in VPS itself?

Please note that, there is no provision to take backup of full VPS image in VPS itself. As an...

how to configure SSH key-based Authentication in Linux VPS or Dedicated Server

This article will guide how to configure SSH key-based Authentication in Linux VPS or Dedicated...

How to Install Redis on Ubuntu?

Redis called as Remote Dictionary Server. Redis is an Open-Source in-memory data structure...