windows使用命令kill进程

参考:https://blog.csdn.net/zaizuxuan/article/details/126950788

  1. 根据进程名找到进程
    例如python进程
PS C:\Users\27467> tasklist | findstr python
python.exe                    7088 Console                    2      3,364 K
python.exe                    1580 Console                    2     41,052 K
  1. 根据占据的端口好找到进程号
    例如想要找到启用端口号为5173的进程PID,最后一位为该进程的PID
C:\Windows\System32>netstat -ano|findstr 5173
  TCP    127.0.0.1:5173         0.0.0.0:0              LISTENING       16696
  1. kill掉进程
    根据上一步查找到的pid kill进程
taskkill /pid 7088 /f

/f表示强制kill

posted @ 2023-07-22 19:18  minseo  阅读(268)  评论(0编辑  收藏  举报