I have several linux devices connected to the same router (of which I am not a administrator). How can I find out the ip addresses of all other devices by executing some commands in one of them?


I believe you could use nmap to get such information.

The below command lists me all the machines/devices connected in my network. It is a home network and it lists me all the machines in my home.

nmap -sP

I believe you need to modify the subnet mask and IP range that you are in to suit your requirements.

| improve this answer | |
  • 2
    why what means? – Tarlo_x Nov 7 '15 at 13:15
  • 5
    nmap -sA nmap option -sA shows similar descriptive results with better readability, which includes device name, IP, mac, etc as with option -sP. I personally prefer -sA over -sP for the readability sake. – Jay Feb 3 '16 at 10:17
  • 1

For a more compact list of connected devices:

nmap -sL 192.168.0.* | grep \(1

nmap -sL 192.168.0.* will list all IPs in subnetwork and mark those, that have name:

Nmap scan report for
Nmap scan report for Dlink-Router.Dlink (
Nmap scan report for
Nmap scan report for android-473e80f183648322.Dlink (
Nmap scan report for

As all interesting records contain parenthesis ( and digit 1, we filter for that with | grep \(1 (backslash is needed to escape parenthesis)

Beware that if two devices have the same name, nmap will show only the one, that was connected to router last

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.