Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am in a LAN and there are 3 Ubuntu, 2 Kubuntu, 2 Windows XP and 2 Windows 7. What commands or tools are available to see what PCs are connected to the LAN that it shows the name of the PC and the IP. Similar to tools like Angry IP that show all PCs in a LAN.

Note that I do not know the IPs or names of the computers connected to the LAN. So the tool or command should look for them to.

share|improve this question

6 Answers 6

up vote 17 down vote accepted

Taken from Finding All Hosts On the LAN From Linux/Windows Workstation

for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null; 
    [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ;

But for a great tool, Nmap. Great for mapping networks.

share|improve this answer
this would work only when the subnet is using /24 addressing. –  Vineet Menon Nov 25 '11 at 5:29
+1 That's a pretty spiffy little IP address scanner. –  Evan Plaice Aug 15 '12 at 6:08

If broadcast isn't disabled on your router...

You can ping the broadcast address.

ping -b 192.168.0

Will broadcast the ping command to every host within the 192.168.0/24 subnet.

Note: It's probably a good idea to keep broadcasting turned off though as that's how hackers can exploit a network using a DDOS Smurf attack. Basically, ping the broadcast address with a packet that has a spoofed destination address (ie the ip address of the victim). There's a little more to it than that but that's what Google is for.

Note: The same also works on Windows but you ping the actual broadcast address (not the subnet).

ping -b
share|improve this answer

As a possible GUI option, the best one I have seen is Angry IP as found in http://angryip.org/download/#linux

Simply download the latest DEB package and install. Then run ipscan from Dash. Here is a screenshot:

enter image description here

share|improve this answer

I always use nmap. To scan for all devices in your network, use:

nmap -sP

More here: http://www.cyberciti.biz/networking/nmap-command-examples-tutorials/

share|improve this answer

The simplest thing is

arp-scan --localnet
share|improve this answer

Arp-scan works great for me too...

If using Wi-Fi:

sudo arp-scan -l --interface=wlan0

-or if using ethernet:

sudo arp-scan -l --interface=eth0

(this last is practically identical to what Rajesh Rajendran posted; the -l standing for --localnet)

If you don't have arp-scan (it doesn't come with Ubuntu by default), just pull up a terminal and type:

sudo apt-get install arp-scan
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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