想要找出哪個 process 佔用 port
0. 先確認一下 port 是不是有在使用 (假設要找的是port 5000 )
$ netstat -anp tcp | grep 5000
tcp4 0 0 *.5000 *.* LISTEN
1. lsof 找出 process 的 PID
$ lsof -i tcp:5000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Python 28606 peicheng 3u IPv4 0xe5b3d523486905f 0t0 TCP *:commplex-main (LISTEN)
osx - Find (and kill) process locking port 3000 on Mac - Stack Overflow
http://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac
沒有留言:
張貼留言