How it works...

When Nmap is simply run on an IP address, it does a basic scan and tells us the ports that are open on the target system. By knowing the open ports, we can identify the services running on the system. In the same way, nmap is used to scan the local system by providing the IP address of the local system.

Nmap can also be used to scan multiple IP addresses at the same time, by simply mentioning the IP addresses one after the other, in the same command. Also, Nmap is used to check which systems are up and running in the network.

It is also used to scan for a particular port using the -p option, and if the -O option is used, it does a fingerprinting of the target system to display which operating system is running on it.

Nmap is also used for doing other tasks, like identifying the software version of the services running on the target system.