Nov 1, 2021

[memo] How to confirm port in usage in Windows

netstat -ano -p tcp | find "80"


netstat is a command to display TCP connections and port.

-a Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.

-n Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.

-o Displays active TCP connections and includes the process ID (PID) for each connection. You can find the application based on the PID on the Processes tab in Windows Task Manager. This parameter can be combined with -a-n, and -p.

-p Shows connections for the protocol specified by Protocol. In this case, the Protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with -s to display statistics by protocol, Protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6.

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat

find is a command to search a string of text