Listing devices on your local network

Plugged my ancient Raspberry Pi in to my router (yeah the original, that doesn’t have on board wifi) and wanted to SSH into it, found this command to easily show you what devices are on your network, listing the IP address and the hostname


nmap -sL 192.168.1.* | grep \(1
Nmap scan report for D-Link.Home (192.168.1.1)
Nmap scan report for envoy (192.168.1.3)
Nmap scan report for Jamess-MBP (192.168.1.4)
Nmap scan report for LGSmartTV (192.168.1.5)
Nmap scan report for MeaganAir (192.168.1.9)
Nmap scan report for LGwebOSTV (192.168.1.10)
Nmap scan report for Meagans-iPhone (192.168.1.12)
Nmap scan report for retropie (192.168.1.13)

There we go, last one on the list. The piping to grep just filters out addresses that are in use, otherwise it’d list all 255 addresses.