参考网址:
解决端口占用问题(port is already in use)_奔跑的大白啊的博客-CSDN博客_端口占用
1、windows+R 组合键,调出命令行窗口

2、查找占用端口对应的PID(进程号)
1 2 3 4 5 6
| # 列出所有端口占用情况 netstat -ano # 精确找到被占用的端口对应的PID netstat -ano|findstr "port" # 示例 netstat -ano|findstr "6644"
|


3、查看是哪个进程或程序占用了端口
1 2 3
| tasklist|findstr "PID" # 示例 tasklist|findstr "4"
|

4、通过命令结束进程
1 2 3
| taskkill /f /t /im xx进程 # 示例 taskkill /f /t /im System
|
5、命令解析
命令 |
描述 |
netstat |
显示协议统计信息和当前TCP/IP网络连接 |
netstat |
查看当前哪些端口正在被使用 |
findstr |
查找字符串,类似Linux下的grep命令 |
tasklist |
显示运行在本地或远程计算机上的所有任务的应用程序和服务列表 |
taskkill |
结束一个或多个任务或进程 |
taskkill /f |
指定强制终止的过程(我觉得是进程) |
taskkill /t |
指定那个终止与父进程一起的所有子进程,常被认为是“树终止” |
taskkill /im |
imageName 指定将被终止的过程的图像名称 |