for i in $(seq 1 254); do if ping -c1 -W1 192.168.1.$i >/dev/null 2>&1; then echo 192.168.1.$i fi done