EN
Windows - how to list all processes that use specific port with cmd?
12
points
Quick solution:
netstat -ano | findstr :your_port_number
1. Introduction
This article is focused to solve problem, how to find all processes ids (PIDs) that listen on specific ports under Windows CMD (Windows Command). Simple solution how to find opened ports with netstat command is described below.
2. netstat
command example
This solution shows composition of two programs. netstat
lists and prints all processes and findstr
finds lines that contain :80
text. Redirection beetwen proceses with pipe (|
) causes that only specific lines will be printed - lines with text passed in first argument of findstr
.
Programs usage in cmd:
C:\>netstat -ano | findstr :80
Where:
- for
netstat
:-a
displays all connections and listening ports,-n
displays addresses and port numbers in numerical form,-o
displays the owning process ID associated with each connection.
- for
findstr
::80
is searching phrase in each line - printed lines contain it.