mac关闭指定端口

1.0  先执行如下命令:

lsof -i:端口号

1.1  会有类似下面的结果:

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)

1.2  然后执行:

kill -9 42624

 

posted @ 2014-07-28 14:45  开心编码源  阅读(386)  评论(0编辑  收藏  举报