Ping-Sweep from the Terminal in OS X

I did something stupid: I lost one of the routers on my network. I currently have a dual-router network setup, mainly for the purpose of running a wireless b/g network and a wireless-N network (5 Ghz). Regardless, I couldn't remember what I set the IP address to for the b/g router. After doing a quick Google-search, I found an easy way to do a ping-sweep in the OS X terminal.

$ for i in {1..254}; do ping -c 1 -W 1 10.1.1.$i | grep 'from'; done

Where the 10.1.1. is, put your network address. For example, for a standard class C range, you could do:

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

The output will look similar to this:

64 bytes from icmp\_seq=0 ttl=255 time=0.291 ms 64 bytes from icmp\_seq=0 ttl=64 time=0.060 ms 64 bytes from icmp\_seq=0 ttl=64 time=0.193 ms