1 找到端口号

​netstat -ano​​命令是用来找到所有被占用的端口号的

如何找到被占用的端口号并杀死进程_tomcat

​netstat -ano|findstr "8089"​​命令是用来找到被8089所占用的PID和其他信息 我们发现被占用的pid为4076

如何找到被占用的端口号并杀死进程_端口号_02

其中​​tasklist|findstr "4076"​​是找到PID为4076的进程程序,发现占用的程序是tomcat8.exe

2 找到PID所占用的程序

如何找到被占用的端口号并杀死进程_tomcat_03

3 终止占用程序的进程

最后使用​​taskkill /f /t /im tomcat8.exe​​终止tomcat的进程