1、nmap -sP 172.18.145.0/24

[root@centos7 ~]# nmap -sP 172.18.145.0/24

Starting Nmap 6.40 ( http://nmap.org ) at 2019-07-26 19:37 CST
Nmap scan report for 172.18.145.1
Host is up (0.0017s latency).
MAC Address: 00:0C:29:DB:F7:F8 (VMware)
Nmap scan report for 172.18.145.12
Host is up (0.0024s latency).
MAC Address: 00:0C:29:2F:0E:96 (VMware)
Nmap scan report for 172.18.145.32
Host is up (0.0017s latency).
MAC Address: 00:0C:29:09:55:BC (VMware)
Nmap scan report for 172.18.145.43
Host is up (0.0021s latency).
MAC Address: 00:0C:29:6B:65:E0 (VMware)
Nmap scan report for 172.18.145.44
Host is up (0.0029s latency).
MAC Address: 00:0C:29:7C:88:AD (VMware)
Nmap scan report for 172.18.145.45
Host is up (0.0021s latency).
MAC Address: 00:0C:29:BB:DE:72 (VMware)
Nmap scan report for 172.18.145.72
Host is up (0.00088s latency).
MAC Address: 00:0C:29:1A:F0:06 (VMware)
Nmap scan report for 172.18.145.83
Host is up (0.00063s latency).
MAC Address: 18:DB:F2:13:43:38 (Unknown)
Nmap scan report for 172.18.145.87
Host is up (0.0018s latency).
MAC Address: 00:0C:29:21:EE:B5 (VMware)
Nmap scan report for 172.18.145.104
Host is up (0.00080s latency).
MAC Address: 00:0C:29:FB:E7:20 (VMware)
Nmap scan report for 172.18.145.106
Host is up (0.00048s latency).
MAC Address: 00:0C:29:4D:59:86 (VMware)
Nmap scan report for 172.18.145.108
Host is up (0.00086s latency).
MAC Address: 00:0C:29:B3:7C:F0 (VMware)
Nmap scan report for 172.18.145.111
Host is up (0.00090s latency).
MAC Address: 00:0C:29:77:4B:2F (VMware)
Nmap done: 256 IP addresses (13 hosts up) scanned in 1.32 seconds

2、nmap -sP 172.18.145.0/24 | grep report

[root@centos7 ~]# nmap -sP 172.18.145.0/24 | grep report
Nmap scan report for 172.18.145.1
Nmap scan report for 172.18.145.12
Nmap scan report for 172.18.145.32
Nmap scan report for 172.18.145.43
Nmap scan report for 172.18.145.44
Nmap scan report for 172.18.145.45
Nmap scan report for 172.18.145.72
Nmap scan report for 172.18.145.83
Nmap scan report for 172.18.145.87
Nmap scan report for 172.18.145.104
Nmap scan report for 172.18.145.106
Nmap scan report for 172.18.145.108
Nmap scan report for 172.18.145.111

3、nmap -sP 172.18.145.0/24 | grep report | awk '{print $5}'

[root@centos7 ~]# nmap -sP 172.18.145.0/24 | grep report | awk '{print $5}'
172.18.145.1
172.18.145.12
172.18.145.32
172.18.145.43
172.18.145.44
172.18.145.45
172.18.145.72
172.18.145.83
172.18.145.87
172.18.145.104
172.18.145.106
172.18.145.108
172.18.145.111