How about something like for ip in [your list of IP addrs here] do ping -c1 $ip arp -n | fgrep $ip >>/tmp/ipAddrMACmap done ...and then crunch that ipAddrMACmap file as desired