Easy Mac Hacks: View LAN-Connected Computers via Terminal

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.

arp -na

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.