群ping脚本

#Windows
for /L %i in (1,1,254) do ping -n 1 -w 100 192.168.1.%i | find "回复" >> ping.txt

#Linux
for i in {1..254};do ping -c1 192.168.3.$i |if [ $(awk '/received/{print $4}') -ne 0 ];then echo 192.168.3.$i >> ping_test.txt; fi;done

 

posted @ 2022-12-01 17:45  咿呀哒喏  阅读(31)  评论(0编辑  收藏  举报