Ping Sweep on a MAC OSX

Below is a command you can run in OSX to do a ping sweep. There are times I need to do one and this is an easy way. You will see I’m sweeping the 192.168.1.x subnet.

for i in {1..254}; do ping -c 1 -W 100 192.168.1.$i | grep 'time='; done

Results:

64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=1.980 ms
64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=0.896 ms
64 bytes from 192.168.1.8: icmp_seq=0 ttl=64 time=54.036 ms
64 bytes from 192.168.1.9: icmp_seq=0 ttl=64 time=2.042 ms
64 bytes from 192.168.1.10: icmp_seq=0 ttl=255 time=2.335 ms
64 bytes from 192.168.1.12: icmp_seq=0 ttl=64 time=0.089 ms
64 bytes from 192.168.1.13: icmp_seq=0 ttl=64 time=80.130 ms
64 bytes from 192.168.1.15: icmp_seq=0 ttl=64 time=2.996 ms
64 bytes from 192.168.1.17: icmp_seq=0 ttl=128 time=2.482 ms