windows查看端口占用,然后关闭程序

版权声明:借鉴时注明出处就行 https://blog.csdn.net/weixin_42144379/article/details/85479202

对于老鸟:  netstat -ano | findStr "8080"           >>>得到端口为8080 的进程pid (结果最后一列)

                  taskkill /pid 876 -t -f                         >>>关闭 pid为 876的进程                 

以下为详情

假设: 我要查看 8080 端口 被谁占用

1 .打开cmd窗口,同时按下 Windows 和 R 键

输入 cmd 按下 回车

2.输入 netstat -ano | findStr "8080" , 这里 8080你可以换作你要查的端口

最后一列,就是占用 端口 的进程的pid 了 ,我这里是 876 这个进程

3.根据 pid (也就是上文找到的 876),关闭进程,输入命令 taskkill /pid 876 -t -f

(图中我是关闭了 pid为 11360 的进程)

猜你喜欢

转载自blog.csdn.net/weixin_42144379/article/details/85479202