How can I scan the local network for connected devices? (Mac OS)
Ping the broadcast address
(you can find it withifconfig | grep broadcast
)and then do an
arp -a
Where x.x.x is the first three numbers in your ip address.
for ip in $(seq 1 254); do ping -c 1 x.x.x.$ip -o ConnectTimeout=5; [ $? -eq 0 ] && echo "x.x.x.$ip UP" || : ; done
Single Line Answer: http://nmap.org/download.html [Use NMAP] or Angry IP Scanner