以下命令可用于杀死占用某端口的所有进程。 root 用户: kill -9 $(lsof -i tcp:端口号 -t) 非 root 用户: kill -9 $(sudo lsof -i tcp:端口号 -t)