mac 终端查看端口命令

查看 端口所在线程 lsof -i:81

COMMAND  PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
java    1867 pengxuan  189u  IPv6 0x3a47bb02362d2d59      0t0  TCP *:hosts2-ns (LISTEN)
java    1867 pengxuan  196u  IPv6 0x3a47bb02362d14d9      0t0  TCP localhost:hosts2-ns->localhost:58358 (CLOSE_WAIT)

杀死端口
pengxuandeMacBook-Air:~ pengxuan$  kill 1867

CneteOS
端口所在线程 netstat -tunpl | grep 81

posted @ 2020-11-12 10:52  pxuan  阅读(1949)  评论(0)    收藏  举报