Command line for looking at specific port Command line for looking at specific port windows windows

Command line for looking at specific port


Here is the easy solution of port finding...

In cmd:

netstat -na | find "8080"

In bash:

netstat -na | grep "8080"

In PowerShell:

netstat -na | Select-String "8080"


You can use the netstat combined with the -np flags and a pipe to the find or findstr commands.

Basic Usage is as such:

netstat -np <protocol> | find "port #"

So for example to check port 80 on TCP, you can do this: netstat -np TCP | find "80"Which ends up giving the following kind of output:

TCP    192.168.0.105:50466    64.34.119.101:80       ESTABLISHEDTCP    192.168.0.105:50496    64.34.119.101:80       ESTABLISHED

As you can see, this only shows the connections on port 80 for the TCP protocol.


I use:

netstat –aon | find "<port number>"

here o represents process ID. now you can do whatever with the process ID. To terminate the process, for e.g., use:

taskkill /F /pid <process ID>