2017年11月21日 星期二

如何查詢Port被哪個程式佔用了


  • windows
    • 用 netstat 命令

C:\>netstat -ano | findstr 0.0:80

    • 結果

TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       1860


    • 其中 1860 就是佔用 port 的程式 PID,再輸入

C:\>tasklist | findstr 1860
得到如下的資訊

httpd.exe                  1860 Services                0      4,148 K
表示佔用的是 httpd.exe,也就是 Apache Server 還開著。




由於最近事情一直不少,先簡短記錄下,之後有機會再更新

參考:
http://herolin.twbbs.org/entry/how-to-check-port-which-used-program-for-windows-and-linux/
// 更新
http://blog.qoding.us/2011/07/windows-how-to-find-out-which-application-is-using-what-port/



# windows 如何查詢被占用的 port
# linux 如何查詢被占用的 port

1 則留言:

  1. 原本參考網址GG了,參考:
    http://blog.qoding.us/2011/07/windows-how-to-find-out-which-application-is-using-what-port/

    回覆刪除