1、查看服务器端口是否被占用 lsof -i:8081 2、查看服务器所有tcp端口 netstat -ntlp 3、查看服务器所有udp端口 netstat -nupl 4、查看所有端口(包括tcp和udp) netstat -nupl 5、杀死端口占用的进程 kill -9 进程号