查看端口有没被占用

sudo lsof -i tcp:port (port替换成端口号,比如6379)可以查看该端口被什么程序占用,并显示PID,方便KILL(kill pid

原文地址:https://www.cnblogs.com/kaibindirver/p/9962873.html