windows 根据 端口号 找到进程ID PID

List process by port number

netstat -ano | findstr 8080

  

Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       29848
  • -a – Displays all connections and listening ports.
  • -o – Displays the owning process ID associated with each connection.
  • -n – Displays addresses and port numbers in numerical form.
taskkill /F /PID 29848

  

原文地址:https://www.cnblogs.com/mingzhanghui/p/9303529.html