Every Monday we show you how to do something quick and cool using built-in OS X utilities such as Terminal, Apple’s command line application. These easy hacks can make life better and simpler, and don’t require any knowledge of coding — all you need is a keyboard to type 'em out!
Sometimes you may want to know exactly if a device on your LAN (local area network) is occupying a particular IP address in order to diagnose issues, or to see if a particular computer with a static address is actually connected. You can also use it to root out Wi-Fi thieves! Using a Terminal command called arp, you can find out this information exactly.
This command will use the address resolution protocol to figure out all of the devices that are currently connected to your network. In the list that is returned, you will find the IP address, the MAC Address of the device that is occupying that IP address, and additional information about the connection (such as the interface that the device was found using). While this won't give you detailed, device-level information, this command is built right into Mac OS X, and allows you to do something that would usually require an network query application to do.
The arp utility, however, uses a cached list of devices, so the MAC address listed may not be always up to date and accurate. To get a pingback of all devices that are currently occupying your network (assuming that those devices respond to pings), then you can send a ping request to your LAN's broadcast IP. (This IP address can be found by consulting your router's manual — we've used the standard Apple AirPort configuration address in this example.)
When you ping this address, you will receive a ping back from all devices that are occupying the network and respond to ping requests. This list will guarantee these devices are alive on your LAN, and are not cached.
Follow this articles author, Cory Bohon on Twitter.