zoukankan      html  css  js  c++  java
  • windows下端口占用解决方法-查看和杀死占用端口进程

    在 Windows 下启动程序时有时会遇到端口被占用的情况,由于一个端口同时只能运行一个进程,所以要想启动新的程序就要先把占用该端口的进程给 kill 掉,具体的命令分为以下三步,

    以杀死占用了 80 端口的进程为例:

    1、根据端口号 “80” 查找进程号
    netstat -ano|findstr "80"
    TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       7796

    2、根据进程号 “7796” 查找进程名
    tasklist|findstr 7796
    java.exe                      7796 Console                    1     57,368 K

    3、根据进程名杀死进程
    taskkill /f /t /im java.exe
    成功: 已终止 PID 7796 (属于 PID 9052 子进程) 的进程。

  • 相关阅读:
    Git
    Spring
    Linux
    Linux
    Linux
    Linux
    Linux
    Linux
    Linux
    Linux
  • 原文地址:https://www.cnblogs.com/hanlk/p/14285187.html
Copyright © 2011-2022 走看看