Useful NMAP commands

nmap -sn TARGET
# will find online hosts without port scanning the live systems
nmap -PR TARGET/24
# will only arp scan the current subnet
sudo nmap -PE TARGET/24
# icmp echo pings the whole subnet
sudo nmap -PP TARGET/24
# icmp timestamp scan
sudo nmap -PM TARGET/24
# icmp address mask query

Sudoers don't need to complete the tcp handshake.

nmap -PS TARGET/24
# will send tcp syn pings to the whole subnet
# if run with sudo the handshake wont be completed i.e. fast
nmap -PA80,20
# will send tcp ack pings to the ports
# same as above
# will get back a RST response
nmap -PU TARGET/24
# will send a udp packet
# if no response then host is up
# if ICMP responds, then host is down/unreachable

disable reverse dns lookup with the -n flag reverse dns scan offline hosts with -R flag