查端口占用: lsof -i:端口号netstat -tlnp | grep 端口号 更多 lsof 的命令如下: lsof -i:8080:查看8080端口占用 lsof abc.txt:显示开启文件abc.txt的进程 lsof -c abc:显示abc进程现在打开的文件 lsof -c -p