1. 根据端口号查进程信息脚本 #!/bin/bash port=$1 lsof -i:$port 2. 根据端口号查进程启动路径脚本 #!/bin/bash port=$1 lsof -ti:$port | awk '{print $1}' | xargs pwdx