Skip to content

Instantly share code, notes, and snippets.

@bxb100
Last active April 16, 2022 14:16
Show Gist options
  • Save bxb100/4de923cac41b28922c335d7afb9b0f79 to your computer and use it in GitHub Desktop.
Save bxb100/4de923cac41b28922c335d7afb9b0f79 to your computer and use it in GitHub Desktop.
检查 windows 端口占用
  • 查找所有运行的端口 netstat -ano
  • 查看被占用端口对应的 PID netstat -aon|findstr "8081" 最后一位数字就是 PID, 这里假定为 9088
  • 查看指定 PID 的进程 tasklist|findstr "9088"
  • 结束进程, 强制(/F参数)杀死 pid 为 9088 的所有进程包括子进程(/T参数) taskkill /T /F /PID 9088

当然最方便的还是用 TcpView


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment