033nc命令集合

一、

(1)使用nc命令测试长连接服务

#执行如下命令,出现出现输出表示4层接口是ok的
nc -vz 119.3.250.211 50000

Connection to 119.3.250.211 50000 port [tcp/*] succeeded!

 (2)更改为批量执行的方式

#检查数量是否一致
ls |wc -l
egrep -i "weight=10" *|awk '{print $3}'|awk -F: '{print $1, $2}'|wc -l

#批量检查
egrep -i "weight=10" *|awk '{print $3}'|awk -F: '{print $1, $2}'|while read ip port; 
  do echo $ip $port
  nc -vz $ip $port
done

  

  

 
posted @ 2023-06-12 17:17  arun_yh  阅读(30)  评论(0编辑  收藏  举报