shell校验某个端口是否启动 port=`lsof -i:8080 | wc -l` if [ "$port" -eq "0" ];then echo "未启动" else echo "已经启动" fi