端口获取PID lsof # 详细 lsof -i:8080 # 仅pid lsof -t -i:8080 netstat netstat -anp | grep 8080 netstat -tunlp | grep ":端口号"