Skip to content

Instantly share code, notes, and snippets.

@zxhfighter
Created January 31, 2018 02:37
Show Gist options
  • Save zxhfighter/8262aa9415ebb279f30acb0c8ec66829 to your computer and use it in GitHub Desktop.
Save zxhfighter/8262aa9415ebb279f30acb0c8ec66829 to your computer and use it in GitHub Desktop.
mac 查看端口占用并杀死进程

Mac 查找端口占用并杀掉端口

查看端口占用

sudo lsof -i :8888

结果如下:

COMMAND  PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
node    9086  xxx   11u  IPv6 0xe320c255f0d85ff7      0t0  TCP *:ddi-tcp-1 (LISTEN)

根据 PID 杀掉进程

sudo kill -9 9086
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment