1. 程式人生 > >mac關閉指定埠

mac關閉指定埠

先執行如下命令:

lsof -i:埠號
會有類似下面的結果: 
COMMAND     PID       USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
WebProces 42624 davidzhang    5u  IPv4 0x907152bbf7b2a875      0t0  TCP localhost:64438->localhost:radan-http (ESTABLISHED)
WebProces 42624 davidzhang   10u  IPv4 0x907152bbf7b64a05      0t0  TCP localhost:64439->localhost:radan-http (ESTABLISHED)
然後執行: 
kill -9 42624
結束程序就搞定了