日常工具-端口占用-Mac-Wind
当前文章内容迁移中,如有问题,请提交 issues 谢谢~~
一. Mac 环境
1. 根据指定端口,查找占用端口的进程的 pid
lsof -i:4000
Result:
starrier:starrier.github.io starrier$ lsof -i:4000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 1879 starrier 46u IPv6 0x8546bfa6d2b2dd07 0t0 TCP *:terabase (LISTEN)
2. 解除端口与进程的关联
kill -9 1897