CMD

How to find and kill a process using a port on Windows CMD

To find a process using a port on Windows using command line,

STEP 1: Open cmd.exe

STEP 2: Run the following command(Replace <PORT> with the port you want to query):

netstat -ano | findstr :[PORT]

This will give you the list of the processes using the specified port in windows.

Other helpful tips:

1. List all processes by process id (pid)

netstat -ano

2. Kill a specific process by process id (Replace <PID> with the actual process id)

taskkill /F /PID [PID]

Here /F is used to forcefully terminate the process.

Leave a Reply