netstat -an |find /c ":80"
一、查看所有的端口
cmd窗口输入以下命令就可查看所有端口的占用情况
t -ano
结果如下
TCP 127.0.0.1:55930 0.0.0.0:0 LISTENING 19864
TCP 127.0.0.1:55931 127.0.0.1:55929 ESTABLISHED 31760
TCP 127.0.0.1:55933 127.0.0.1:55934 ESTABLISHED 31760
TCP 127.0.0.1:55934 127.0.0.1:55933 ESTABLISHED 31760
TCP 127.0.0.1:55936 127.0.0.1:55937 ESTABLISHED 31760
TCP 127.0.0.1:55937 127.0.0.1:55936 ESTABLISHED 31760
TCP 127.0.0.1:55939 127.0.0.1:55940 ESTABLISHED 31760
TCP 127.0.0.1:55940 127.0.0.1:55939 ESTABLISHED 31760
TCP 127.0.0.1:55986 127.0.0.1:55987 ESTABLISHED 31760
TCP 127.0.0.1:55987 127.0.0.1:55986 ESTABLISHED 31760
TCP 127.0.0.1:55990 127.0.0.1:55991 ESTABLISHED 31760
TCP 127.0.0.1:55991 127.0.0.1:55990 ESTABLISHED 31760
TCP 127.0.0.1:56196 127.0.0.1:65367 ESTABLISHED 17176
TCP 127.0.0.1:56197 127.0.0.1:65347 ESTABLISHED 17176
TCP 127.0.0.1:56205 127.0.0.1:65386 ESTABLISHED 17176
TCP 127.0.0.1:56209 127.0.0.1:65367 ESTABLISHED 17176
TCP 127.0.0.1:56514 127.0.0.1:56515 ESTABLISHED 18012
TCP 127.0.0.1:56515 127.0.0.1:56514 ESTABLISHED 18012
TCP 127.0.0.1:58139 127.0.0.1:58140 ESTABLISHED 16796
TCP 127.0.0.1:58140 127.0.0.1:58139 ESTABLISHED 16796
TCP 127.0.0.1:58141 127.0.0.1:54338 ESTABLISHED 16796
TCP 127.0.0.1:58681 127.0.0.1:58682 ESTABLISHED 17176
TCP 127.0.0.1:58682 127.0.0.1:58681 ESTABLISHED 17176
TCP 127.0.0.1:59436 127.0.0.1:59439 ESTABLISHED 21564
TCP 127.0.0.1:59437 127.0.0.1:59438 ESTABLISHED 21564
TCP 127.0.0.1:59438 127.0.0.1:59437 ESTABLISHED 21564
TCP 127.0.0.1:59439 127.0.0.1:59436 ESTABLISHED 21564
TCP 127.0.0.1:59440 0.0.0.0:0 LISTENING 21564
TCP 127.0.0.1:59440 127.0.0.1:59441 ESTABLISHED 21564
TCP 127.0.0.1:59441 127.0.0.1:59440 ESTABLISHED 21564
二、查看指定端口
cmd窗口输入如下命令即可查看指定端口
netstat -ano | findstr ":80"
结果如下
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 21920
TCP 0.0.0.0:8081 0.0.0.0:0 LISTENING 2880
TCP 10.11.68.77:80 10.11.68.77:64034 ESTABLISHED 21920
TCP 10.11.68.77:51966 117.18.237.29:80 TIME_WAIT 0
TCP 10.11.68.77:51977 104.71.141.206:80 TIME_WAIT 0
TCP 10.11.68.77:51982 182.254.116.117:80 TIME_WAIT 0
TCP 10.11.68.77:51985 182.254.116.117:80 TIME_WAIT 0
TCP 10.11.68.77:51986 182.254.116.117:80 TIME_WAIT 0
TCP 10.11.68.77:51987 182.254.116.117:80 TIME_WAIT 0
TCP 10.11.68.77:51988 182.254.116.117:80 TIME_WAIT 0
TCP 10.11.68.77:51989 115.29.112.65:80 ESTABLISHED 14408
TCP 10.11.68.77:51995 182.254.116.117:80 TIME_WAIT 0
TCP 10.11.68.77:51998 182.254.116.117:80 TIME_WAIT 0
TCP 10.11.68.77:52001 49.7.176.52:80 CLOSE_WAIT 5220
TCP 10.11.68.77:52002 49.7.115.34:80 CLOSE_WAIT 5220
TCP 10.11.68.77:52003 49.7.115.34:80 CLOSE_WAIT 5220
TCP 10.11.68.77:52004 182.254.118.119:80 TIME_WAIT 0
TCP 10.11.68.77:54164 117.18.237.29:80 CLOSE_WAIT 8860
TCP 10.11.68.77:55826 183.47.100.43:8080 ESTABLISHED 31760
TCP 10.11.68.77:56517 42.81.183.216:8080 ESTABLISHED 18012
TCP 10.11.68.77:63445 42.81.125.144:80 CLOSE_WAIT 31760
TCP 10.11.68.77:64034 10.11.68.77:80 ESTABLISHED 14408
TCP [::]:8081 [::]:0 LISTENING 2880