Thursday, September 21, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  5] [ 0]  / answers: 1 / hits: 5280  / 7 Months ago, wed, march 1, 2023, 1:09:22
sudo arp-scan --interface=eth0 --localnet

I know the above command works fine but it outputs everything like MAC address etc, etc.
But I need to find only IP addresses. Is it possible ?

More From » networking


I just used awk,tail and head to achieve what you want:

sudo arp-scan --interface=eth0 --localnet| awk '{print $1}'|tail -n +3|head -n -2

this gives the output as

as I have only these two in my Lan.

Here awk '{print $1}' prints the ip address which is situated in the first column.
tail and head removes unnecessary stuff like the header and just shows the ip addresses.

[#26444] Friday, March 3, 2023, 7 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 10
Total Questions: 113
Total Answers: 117

Location: Burundi
Member since Sat, Aug 21, 2021
2 Years ago