1、
for ip in 192.168.0.{1..255} do ping $ip -c 2>&1 /dev/null if [ $? -ne 0] then echo "$ip is alive" fi done
2、fping -a 192.168.0.1/24 -g 2>/dev/null
1、
for ip in 192.168.0.{1..255} do ping $ip -c 2>&1 /dev/null if [ $? -ne 0] then echo "$ip is alive" fi done
2、fping -a 192.168.0.1/24 -g 2>/dev/null