Sample Header Ad - 728x90

get connected lan hosts via arp and output on single line

0 votes
0 answers
25 views
I'm using the following nmap command nmap -sP 192.168.1.0/24 | awk '{print $1}'`| awk '/Nmap scan report for/{print " "$5,$6;}/MAC Address:/{print $3;}' which outputs box1.lan (192.168.1.119) 00:0E:C7:82:48:10 box2.lan (192.168.1.189) 00:E0:4F:68:01:14 how do i get it to output as 00:0E:C7:82:48:10 box1.lan 192.168.1.119 00:E0:4F:68:01:14 box2.lan 192.168.1.189
Asked by Lurch (125 rep)
Dec 11, 2024, 02:03 PM