Using nmap to scan networks (Awesome Linux Tools)

nmap is a network mapping utility that you can use to gather information regarding the nodes on your network. With nmap, you can perform port scanning, OS fingerprinting, and more! In this tutorial, you’ll learn the basics of using nmap.

YouTube player

nmap cheat sheet

Installing nmap


sudo apt install nmap

Arch Linux

pacman -S nmap

Alma Linux, CentOS, Fedora, Rocky Linux, Red Hat (etc)

sudo dnf install nmap

Viewing the version number of the installed nmap

nmap -v

Scan an IP address or fully-qualified domain name

Note: IP addresses shown for example purposes only


Scan an IP address or fully-qualified domain name, and show more verbose output

nmap -v

Scan multiple IP addresses


Scan a range of IP addresses


Scan a range of IP addresses, but exclude a single IP address

nmap --exclude

View service and version information for individual ports on a host

nmap -sV

Attempt to determine the operating system of a host

nmap -A

Scan an entire subnet


Determine if a host or network is behind a firewall

nmap -sA

View condensed output for a host

nmap -sP

Scan a host that’s behind a firewall

nmap -PN

Perform a fast scan (not as accurate on slower networks)

nmap -T5

Display the reason a port is in the state that it’s in

nmap --reason

Show incoming and outgoing packets

nmap --packet-trace

Show host network and route info

nmap --iflist

Scan a specific port

nmap -p 80

Scan a specific port (and specify TCP)

nmap -p T:80

Scan a specific port (and specify UDP)

nmap -p U:80

Scan more than one specific port

nmap -p 80,443

Scan a range of ports

nmap -p 80-200

Brand-New Course!

Discount Vouchers

Receive 5% off an LPI exam voucher!

Exclusive Member Features

Support the channel and receive exclusive perks!