Skip to content

nmap command

Scan hosts for open ports and services.

On this page

Syntax

nmap [options] target

Provided by the nmap package. Run man nmap for the full manual.

Common options

OptionWhat it does
-p PORTSPorts to scan, e.g. 22,80 or 1-1000
-sVDetect service versions
-snPing scan only (find hosts)
-FFast: top 100 ports
-AOS, versions, scripts and traceroute
-PnSkip host discovery

Examples

  1. Scan the common ports of a host

    nmap 192.0.2.10
  2. Scan specific ports

    nmap -p 22,80,443 example.com
  3. Scan all ports

    nmap -p- 192.0.2.10
  4. Detect service versions

    nmap -sV 192.0.2.10
  5. Find live hosts on a subnet

    nmap -sn 192.0.2.0/24

Tips

  • Only scan hosts you own or have permission to test.

nmap guides

← All Linux commands · Suggest a fix

Back to top