How to check which Process is holding TCP Port - Using netstat command

How to check if a port is used by any application (use netstat)

After changing to the new port, you can confirm whether the old port is still in use with the following command.

  1. Open the command line
  2. Run the command below (change the port to whatever port you want to search)
    netstat -ano | findstr :50433
  3. If Port not used, you will see a blank; else it may showa few entries like below

How to check which process is holding this port

Here’s a clearer version of the text:

To identify which process is using a specific port number, follow these steps:

  1. Run the command to search for the port and note the PID (Process ID), which is the last column in the console output. This PID corresponds to the process that is holding the port.
    netstat -ano | findstr :5000
  2. Open the Task Manager.
  3. Navigate to the Details tab.
  4. Sort the list by the PID column and locate the PID to match it with the console output. This will identify the process that is holding the port.

To release the port, you need to terminate this process. If possible, avoid killing it abruptly; instead, try to exit it gracefully.