Sometimes you may need to kill process running on a particular port in your system. In this article, we will look at how to kill process running on specific port on Windows and Linux.
How to Kill Process Running on Specific Port
We will look at how to kill processes running on specific port in Windows & Linux. We will look at how to kill process running on port 80.
Windows
On windows, open command prompt and enter the following command.
c:\> netstat -ano | findstr :80
The last column of the output will display process ID.

You can kill the processes using taskkill command. Here is its syntax.
taskkill /PID <PID> /F
Here is the command to kill our process running on port 80.
taskkill /PID 3740 /F
Linux
Open terminal and run the following command to find processes running on port 80.
$ sudo lsof -i:80
To kill this process, run the following command.
$ sudo kill $(lsof -t -i:80) OR $ sudo kill -9 $(lsof -t -i:80)
You may also use fuser command similarly, as shown.
$ sudo fuser 80/tcp OR $ fuser -k 80/tcp
In this article, we have learnt how to kill process running on a specific port.
Also read:
Sed Command to Delete Lines in Linux
How to Install & Use Wine in Linux
How to Iterate Over Multiple Lists in Parallel in Python
How to List All Files in Directory in Python
How to Send HTML Email with Attachment in Python
Related posts:
How to Save Grep Output to File in Linux
How to Batch Convert PNG to JPG in Linux
How to View User Login History in Linux
How to Find Unused IP Addresses in Network
How to Delete Last Field in Linux
How to Completely Uninstall PostgreSQL from Ubuntu
How to Fix SSH Connection Refused Error
How to Connect to MySQL Server via SSH Tunnel

Sreeram has more than 10 years of experience in web development, Python, Linux, SQL and database programming.