netstat -anp|grep 端口号root用户只需netstat -ntupln表示不查询dnst表示tcp协议u表示udp协议p表示查询占用的程序l表示查询正在监听的程序查看那个进程占用了xxx端口lsof -i:xxx查看进程好为xxx的进程在哪里ps -ef|grep xxxps -ef|grep 程序名netstat -nltp |grep 端口号或服务号