lsof 查看端口是哪个程序开的 lsof -i TCP:port -n lsof -i UDP:port -nlsof -i :port -n另:netstat -ln #查看都开了哪些端口 lsof -a -p pid|grep LISTEN #查看进程打开的端口信息