sudo arp-scan -l

ARP Scan

A much quicker and (not dirtier) option. use the man page for help. On linux/ubuntu you will need to `sudo apt-get -y install arp-scan`.
Sample Output
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.6 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.1	00:23:97:47:9d:45	(Unknown)
192.168.1.3	00:1f:33:e6:63:14	(Unknown)
192.168.1.4	38:e7:d8:bc:04:f2	(Unknown)
192.168.1.8	00:0c:29:8f:18:ad	VMware, Inc.
192.168.1.9	00:0d:4b:54:9b:01	Roku, LLC
192.168.1.100	00:24:a0:05:09:f2	(Unknown)

6 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.6: 256 hosts scanned in 2.245 seconds (114.03 hosts/sec).  6 responded

7
2011-02-21 21:58:27

2 Alternatives + Submit Alt

What Others Think

Problem being is that arp-scan isnt installed by default on a number of disto`s.
felix001 · 378 weeks and 3 days ago
neither *cough* is arping # arping -sh: arping: command not found
linuxrawkstar · 378 weeks and 3 days ago
PS- your loop is very graceful and I voted you up. Very clever scripting.
linuxrawkstar · 378 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: