nmap -sn 192.168.1.0/24 | awk '/for /{print $5}'

Category: Local Network & Public Hosting

nmap -sn 192.168.1.0/24 | awk '/for /{print $5}'

List only the IPs that answer a ping sweep

The ping sweep -sn checks every address in the subnet without port scanning, and the awk filter pulls just the IP from each Nmap scan report line. The result is a clean one-per-line list of live hosts. Use it to feed other tools, for example a loop that pings or SSHes each responder.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.