Linux Terminal Command: nmap

The nmap command is an essential tool in Network Utilities. In this tutorial, we will explore what nmap does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.


Concept & Explanation

The nmap command scans local or remote systems to identify active hosts, open ports, and running operating system details.


Common Options & Syntax

nmap [options] [arguments]

Here are the most common flags used with nmap:


1. Interactive Example (Simple)

Here is how most people run the command:

# Example
nmap 192.168.1.1

What it does: Scans the 1000 most common ports of the target IP address.


2. Power-User Example (Advanced)

For scripting and advanced diagnostics, use this configuration:

# Advanced
sudo nmap -sS -O -p 80,443,22 192.168.1.0/24

What it does: Scans local subnet for active web and SSH services, using stealth TCP SYN scanning (-sS) and runs OS fingerprinting detection (-O).


⚙️ Warning & Common Pitfalls

[!WARNING] Scanning networks you do not own or have permission to test can be detected as an attack vector and is illegal. Always scan within authorized boundaries.


Here are some related posts on cli_tty1 you might want to check out: