有没有办法从Windows命令行检查特定端口的状态?我知道我可以使用netstat来检查所有端口,但netstat速度很慢,而且查看特定端口可能不是这样。
发布于 2014-06-18 11:54:22
这是端口查找的easy solution ...
在cmd中:
netstat -na | find "8080"在bash中:
netstat -na | grep "8080"在PowerShell中:
netstat -na | Select-String "8080"发布于 2012-08-18 02:03:12
您可以结合使用netstat和-np标志以及指向find或findstr命令的管道。
基本用法如下:
netstat -np <protocol> | find "port #"例如,要检查TCP上的端口80,您可以这样做:netstat -np TCP | find "80",它最终会给出以下类型的输出:
TCP 192.168.0.105:50466 64.34.119.101:80 ESTABLISHED
TCP 192.168.0.105:50496 64.34.119.101:80 ESTABLISHED如您所见,这只显示了TCP协议的端口80上的连接。
发布于 2014-09-25 12:26:54
我使用:
netstat –aon | find "<port number>"这里o代表进程ID。现在你可以对进程ID做任何事情。要终止进程,例如,使用:
taskkill /F /pid <process ID>https://stackoverflow.com/questions/12010631
复制相似问题