$ for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; done
Output:
192.168.1.1 UP 192.168.1.1 UP 192.168.1.2 UP 192.168.1.5 UP ...... ... .. 192.168.1.254 UP
$ for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; done
Output:
192.168.1.1 UP 192.168.1.1 UP 192.168.1.2 UP 192.168.1.5 UP ...... ... .. 192.168.1.254 UP
No comments:
Post a Comment