nmap output only good ips code example Example: nmap output ip only nmap -n -sn 192.0.2.0/24 -oG - | awk '/Up$/{print $2}'