• 查詢目前使用中的 port 及 process id
    lsof -n -i | grep LISTEN

  • 查詢特定 port 的服務,以 80 port 為例
    lsof -n -i:80 | grep LISTEN

參考資料:

https://stackoverflow.com/questions/4421633/who-is-listening-on-a-given-tcp-port-on-mac-os-x

Leave a Reply