get IPs only from arp -a with #vim

arp -a

? (192.168.1.111) at 50:b7:c3:xx:xx:xx [ether] on eth0
? (192.168.1.1) at c8:d7:19:xx:xx:xx [ether] on eth0
? (192.168.1.116) at  on eth0
? (192.168.1.106) at 70:9e:29:xx:xx:xx [ether] on eth0
? (192.168.1.28) at 9c:b6:54:xx:xx:xx [ether] on eth0
? (192.168.1.119) at 70:9e:29:xx:xx:xx [ether] on eth0
? (192.168.1.101) at 50:b7:c3:xx:xx:xx [ether] on eth0
? (192.168.1.4) at b8:27:eb:xx:xx:xx [ether] on eth0
? (192.168.1.105) at 20:e5:2a:xx:xx:xx [ether] on eth0
? (192.168.1.31) at  on eth0
? (192.168.1.26) at 20:4e:7f:xx:xx:xx [ether] on eth0
? (192.168.1.104) at 34:36:3b:xx:xx:xx [ether] on eth0
? (192.168.1.103) at 00:90:f5:xx:xx:xx [ether] on eth0
? (192.168.1.108) at e4:e0:c5:xx:xx:xx [ether] on eth0
? (192.168.1.107) at 6c:ad:f8:xx:xx:xx [ether] on eth0
? (192.168.1.112) at b0:79:94:xx:xx:xx [ether] on eth0
? (192.168.1.102) at 6c:ad:f8:xx:xx:xx [ether] on eth0

with vim:
:%s/.*(\(.*\)).*/\1/g

192.168.1.111
192.168.1.1
192.168.1.116
192.168.1.106
192.168.1.28
192.168.1.119
192.168.1.101
192.168.1.4
192.168.1.105
192.168.1.31
192.168.1.26
192.168.1.104
192.168.1.103
192.168.1.108
192.168.1.107
192.168.1.112
192.168.1.102

Leave a Reply

Your email address will not be published. Required fields are marked *