命令 lsof -i tcp:port (port替换成端口号,比如6379)可以查看该端口被什么程序占用,
并显示PID,方便KILL
lsof -i tcp:3000
localhost:test Hugo$ lsof -i tcp:3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 1144 Hugo 11u IPv6 0xcb11c831431813eb 0t0 TCP *:hbci (LISTEN)