MaxOS查看端口占用情况及杀死进程

node下经常碰到端口占用
1.ctl + c 停止

2.终端命令
lsof -i :8800

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 25903 think 12u IPv6 0x336cd2c9c7e0330d 0t0 TCP *:sunwebadmin (LISTEN)
node 25903 think 19u IPv6 0x336cd2c99f435dcd 0t0 TCP localhost:sunwebadmin->localhost:56763 (CLOSE_WAIT)

然后根据PID杀进程:

sudo kill -9 25903

你可能感兴趣的:(MaxOS查看端口占用情况及杀死进程)