{"id":77533,"date":"2023-11-08T09:08:44","date_gmt":"2023-11-08T03:38:44","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/"},"modified":"2025-12-31T13:56:47","modified_gmt":"2025-12-31T08:26:47","slug":"nmap-commands","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/","title":{"rendered":"Top 8 Nmap Commands you Should Know"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"introduction\"><strong>Introduction&nbsp;<\/strong><\/h2>\n\n\n\n<p>Nmap is a tool used for network mapping and it is one of the most popular <a href=\"https:\/\/www.mygreatlearning.com\/blog\/ethical-hacking-tools\/\" target=\"_blank\" rel=\"noreferrer noopener\">ethical hacking tools<\/a> in the market. Nmap is used to discover free networks around you. Network administrators find Nmap very useful as they always need to map their networks.&nbsp;<\/p>\n\n\n\n<p>Hackers also started using Nmap for auditing networks and other purposes.&nbsp;<\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Academy PRO<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/ethical-hacking-techniques\" class=\"courses-cta-title-link\">Ethical Hacking Course: Master Hacking Techniques<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">Enroll in our Ethical Hacking course to learn the latest hacking techniques and cybersecurity skills. Become an expert in ethical hacking today!<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>2 Projects<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>6.37 Hrs<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/ethical-hacking-techniques\" class=\"courses-cta-button\">\n                Ethical Hacking Course\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<p>In this guide, we are going to look at What Nmap is, Nmap commands, and some more useful information about Nmap.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-nmap\"><strong>What is Nmap?&nbsp;<\/strong><\/h2>\n\n\n\n<p>Nmap is a short form of Network Mapper and it\u2019s an open-source tool that is used for mapping networks, auditing and security scanning of the networks. The reason behind its development is to quickly find large networks at a specific location. For the discovery of networks, the raw IP packets are used by Nmap. The most common use of Nmap is for security audits of networks.&nbsp;<\/p>\n\n\n\n<p>As we see the rise in <a href=\"https:\/\/www.mygreatlearning.com\/blog\/internet-of-things\/\" target=\"_blank\" rel=\"noreferrer noopener\">IoT devices<\/a> and therefore, the networks are getting more complex for the companies using IoT devices. In this situation, Nmap comes into view where it can be used for auditing the network traffic between web servers of the organisation and the IoT devices.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-learn-about-nmap\"><strong>Why learn about Nmap?<\/strong><\/h2>\n\n\n\n<p>There can be various reasons to learn about Nmap. However, some of them include the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It allows you to quickly find the networks and the devices on a specific network.&nbsp;<\/li>\n\n\n\n<li>Nmap is useful to find out which services are running on a system that includes all the web services and DNS servers.&nbsp;<\/li>\n\n\n\n<li>You can also find information about the operating system running on devices on a network.&nbsp;<\/li>\n\n\n\n<li>The GUI of Nmap is Zenmap which you can use to see the mappings of a network to use it for reporting and to enhance its usage.&nbsp;<\/li>\n\n\n\n<li>You can easily find out unauthorized services on your network.<\/li>\n\n\n\n<li>Nmap helps you to find the devices with open ports and you can look at them to enhance their security.&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"nmap-command-examples-in-linux-and-unix\"><strong>Nmap Command Examples in Linux and Unix<\/strong><\/h2>\n\n\n\n<p>The port scanning is restricted and may result in an unethical practice from some jurisdictions' point of view. Therefore, the Unix Lab setup can be done as follows:<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-full zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/08\/image-8.png\"><img decoding=\"async\" width=\"981\" height=\"594\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/08\/image-8.png\" alt=\"Nmap Commands\" class=\"wp-image-77536\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/08\/image-8.png 981w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/08\/image-8-300x182.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/08\/image-8-768x465.png 768w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/08\/image-8-696x421.png 696w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/08\/image-8-694x420.png 694w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/08\/image-8-150x91.png 150w\" sizes=\"(max-width: 981px) 100vw, 981px\" \/><\/figure>\n\n\n\n<p>In the above diagram, the Lab is set up in this way where,<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Server (1) is powered by an Operating system such as Win\/macOS or Linux that will work as an unpatched server.&nbsp;<\/li>\n\n\n\n<li>Wks01 shows your operating system used for scanning the local networks using Nmap.&nbsp;<\/li>\n\n\n\n<li>Server (2) works the same as the server(1) where it is also powered by the operating system but the difference is that it is a fully patched server integrated with a firewall.&nbsp;<\/li>\n\n\n\n<li>All three systems such as Server(1), wks01 or the operating system, and server(2) are connected via a network switch.&nbsp;<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted has-white-background-color has-background\">                                                           <strong>Check out this <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/linux-tutorial\" target=\"_blank\" rel=\"noreferrer noopener\">Linux Tutorial<\/a><\/strong><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"features-of-nmap\"><strong>Features of Nmap<\/strong><\/h2>\n\n\n\n<p>There are several features of Nmap that include the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>OS Detection:<\/strong> OS scanning can be done in Nmap that detects the OS, version of the OS, and other details about it.&nbsp;<\/li>\n\n\n\n<li><strong>Service Detection:<\/strong> The several service probs found in the Nmap-services-probe-file are used to get the responses from network services and their applications.&nbsp;<\/li>\n\n\n\n<li><strong>Host discovery:<\/strong> This method is used by network hosts to gather data about other hosts in the network by the use of TCP and UDP protocols.<\/li>\n\n\n\n<li><strong>Target Specification:<\/strong> The target specification feature can be used to specify a Target IP address that you want to scan in Nmap.&nbsp;<\/li>\n\n\n\n<li><strong>IPv6 Support:<\/strong> IPv6 means Internet Protocol version 6 and it can be used in Nmap for scanning the network. As IPv6 is capable of scanning larger addresses than IPv4, it makes scanning through CIDR-style scanning ranges that make it idle for scanning larger addresses.&nbsp;<\/li>\n\n\n\n<li><strong>NSE Functionality:<\/strong> NSE stands for Nmap Scripting Engine and it comes in Nmap functionality that you can use for host discovery, network scanning, and target specification.<\/li>\n\n\n\n<li><strong>TLS\/SSL scanning:<\/strong> The TLS deployment problems can be analyzed fastly with the help of Nmap.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"nmap-commands\"><strong>Nmap Commands<\/strong><\/h2>\n\n\n\n<p id=\"nmap-commands\">Here is the list of Nmap Commands<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Scan a Range of IP Address<\/li>\n\n\n\n<li>Port Scanning<\/li>\n\n\n\n<li>Ping Scan Using Nmap<\/li>\n\n\n\n<li>Saving the Nmap Scan Output to a File<\/li>\n\n\n\n<li>Most Popular Ports Scanning<\/li>\n\n\n\n<li>Display Open Ports:<\/li>\n\n\n\n<li>Exclude Host\/ IP Addresses for the Scan<\/li>\n\n\n\n<li>Service Version Detection<br><br>1. <strong>Scan a Range of IP Address:<\/strong> To scan a range of IP addresses, the Nmap command is as follows:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap 192.168.1.1-24<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>2. <strong>Port Scanning<\/strong>: There are multiple commands in Nmap for scanning ports such as:<\/li>\n<\/ul>\n\n\n\n<p>To scan TCP port 80, the following Nmap command can be used:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap -p T:80 192.168.1.1\n\nTo scan UDP port 53:\n\nnmap -p U:53 192.168.1.1\n\nTo scan the range of ports:\n\nnmap -p 80-160 192.168.1.1<\/pre>\n\n\n\n<p>We can also combine all these commands to scan multiple ports:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap -p U:53, 112, 135, T:80, 8080 192.168.1.1<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>3. <strong>Ping Scan Using Nmap<\/strong>: It can be used for host discovery and the following command can be used:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap -sP 192.168.1.1\/20<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>4. <strong>Saving the Nmap Scan Output to a File<\/strong>: The syntax for the command to save the Nmap output to a text file is as follows:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap 192.168.1.1 &gt; op.txt\n\nnmap -oN \/temp\/files\/output\/ 192.168.1.1\n\nnmap -oN op.txt 192.168.1.1<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>5. <strong>Most Popular Ports Scanning<\/strong>: The most popular TCP ports can be scanned using TCP SYN scan and the following command exists for this purpose:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap -sS 192.168.1.1<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the above command is used for stealthy scan<\/li>\n<\/ul>\n\n\n\n<p>For OS fingerprinting, the following command can be used:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap -sT 192.168.1.1<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>6. <strong>Display Open Ports<\/strong>: The command for displaying open ports on the network is as follows:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap \u2013open 192.168.1.1\n\nnmap \u2013open server2.gl.biz\n\nnmap \u2013open 192.168.0.1<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>7. <strong>Exclude Host\/ IP Addresses for the Scan<\/strong>: In order to exclude the hosts from the Nmap scan, you can use the following Nmap commands:<\/li>\n<\/ul>\n\n\n\n<p>If you are scanning a number of hosts\/networks, then you can exclude hosts\/IPs from a scan by using:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap 192.168.1.1-24 \u2013exclude 192.168.1.4<\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap 192. 168.1.1-24 \u2013exclude 192.168.1.3, 192.168.1.7<\/pre>\n\n\n\n<p>for excluding more than one host.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>8. <strong>Service Version Detection:<\/strong> The service version can be detected for IPv4 script with the help of Nmap by using any of the following commands:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-background-color has-background\">nmap -A 192.168.1.254\n\nor\n\nnmap -v -A 192.168.1.1\n\nor\n\nnmap -A -iL \/user\/temp\/list.txt<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"nmap-commands-cheat-sheet\"><strong>NMAP Commands Cheat Sheet<\/strong><\/h2>\n\n\n\n<p>The following is a Nmap Command CheatSheet that contains some useful Nmap Commands:<\/p>\n\n\n\n<p><strong>Nmap commands for Port Selection:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Description<\/strong><\/td><td><strong>Commands<\/strong><\/td><\/tr><tr><td>To scan a single port using Nmap:<\/td><td>nmap -p 8 192.168.1.1<\/td><\/tr><tr><td>To scan a range of ports using Nmap:<\/td><td>nmap -p 1-20 192.168.1.1<\/td><\/tr><tr><td>For scanning common ports of the network:<\/td><td>nmap -F 192.168.1.1<\/td><\/tr><tr><td>If you want to scan all the 65532 ports of the network, then use the corresponding command:<\/td><td>nmap -p- 192.168.1.1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Nmap Commands for Target Selection:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Description<\/strong><\/td><td><strong>Commands<\/strong><\/td><\/tr><tr><td>To scan a single IP host:<\/td><td>nmap 192.168.1.1<\/td><\/tr><tr><td>For scanning the range of IPs:<\/td><td>nmap 192.168.1.1-15<\/td><\/tr><tr><td>If you want to scan a single host:<\/td><td>nmap www.&lt;hostname&gt;.com<\/td><\/tr><tr><td>For scanning targets from text file, you should use the corresponding Nmap command:<\/td><td>nmap -iL target-ip-lists.txt<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>These commands are used to perform default scans using Nmap and it scans 1000 TCP ports where host discovery will also take place.&nbsp;<\/p>\n\n\n\n<p><strong>Nmap commands for OS and Version Detection:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Description<\/strong><\/td><td><strong>Commands<\/strong><\/td><\/tr><tr><td>For detection of OS and the services:<\/td><td>nmap -A 192.168.1.1<\/td><\/tr><tr><td>To detect aggressive services:<\/td><td>nmap -sV \u2013version-intensity 4 192.168.1.1<\/td><\/tr><tr><td>For standard version detection:<\/td><td>nmap -sV 192.168.1.1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The above commands are used to determine the operating system running on a particular port of the network. The command that we discussed for aggressive services detection can be used for the services running on unusual ports of the network.&nbsp;<\/p>\n\n\n\n<p><strong>Nmap commands for different Output Formats:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Description&nbsp;<\/strong><\/td><td><strong>Commands<\/strong><\/td><\/tr><tr><td>If you want to save default output to a file:<\/td><td>nmap -oN op.txt 192.168.1.1<\/td><\/tr><tr><td>To save the output in all formats:<\/td><td>nmap -oA op 192.168.1.1<\/td><\/tr><tr><td>To save results in XML format:<\/td><td>nmap -oX op.xml 192.168.1.1<\/td><\/tr><tr><td>To save the Nmap results in format for grep:<\/td><td>nmap -oG op.txt 192.168.1.1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The default output can also be saved by simple redirecting the file with the command: command&gt;file. In the above command, oN is used to save the results and also monitors the terminal for scanning.&nbsp;<\/p>\n\n\n\n<p><strong>Nmap command for IP address info:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>To get the information of IP Address:<\/td><td>nmap- --script=asn-query, whois, ip-geolocation-stateloc 192.168.0.1\/22<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The command above can be used to get the details related to the IP address and owner of that IP address. This command uses WhoIS, GeoIP location lookups and ASN query.&nbsp;<\/p>\n\n\n\n<p><strong>Nmap commands to gather HTTP service information:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Description<\/strong><\/td><td><strong>Commands<\/strong><\/td><\/tr><tr><td>To get the HTTP headers of web services:<\/td><td>nmap \u2013script=http-title 192.168.1.0\/24<\/td><\/tr><tr><td>Command to find web apps from specific paths:<\/td><td>nmap \u2013script=http-enum 192.168.1.0\/24<\/td><\/tr><tr><td>To gather the data about page titles from HTTP services:<\/td><td>nmap \u2013script=http-title 192.168.10\/24<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>These commands used to get the details about HTTP service are very useful for larger networks as it identifies the HTTP services on the network and reports immediately results.&nbsp;<\/p>\n\n\n\n<p><strong>To get more information about NSE scripts:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Description<\/strong><\/td><td><strong>Commands<\/strong><\/td><\/tr><tr><td>To scan some default scripts:&nbsp;<\/td><td>nmap -sV -sC 192.168.1.1<\/td><\/tr><tr><td>Nmap command for scanning a set of scripts:<\/td><td>nmap -sV \u2013script=aqb* 192.168.1.1<\/td><\/tr><tr><td>To scan a specific NSE script:<\/td><td>nmap -sV -p 443 \u2013script=ssl-gl.nse 192.168.1.1<\/td><\/tr><tr><td>To get help for a script:&nbsp;<\/td><td>nmap \u2013script-help=ssl-gl<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>There are several NSE scripts in nmap that can be used for a wide range of security testing in the network. These scripts are also helpful in the discovery of new networks. The -sV parameter used in the commands above is used as a service detection parameter.&nbsp;<\/p>\n\n\n\n<p><strong>Nmap commands for port scan types:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Description<\/strong><\/td><td><strong>Commands<\/strong><\/td><\/tr><tr><td>To scan selected ports&nbsp;<\/td><td>nmap -Pn -F 192.168.1.1<\/td><\/tr><tr><td>Nmap command to scan UDP ports:<\/td><td>nmap -sU -p 123, 161, 162, 192.168.1.1<\/td><\/tr><tr><td>To scan using TCP SYN scan :&nbsp;<\/td><td>nmap -sS 192.168.1.1<\/td><\/tr><tr><td>To scan using TCP connect to port:&nbsp;<\/td><td>nmap -sT 192.168.1.1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>These commands are very useful to scan port types. The SYN scan requires some privileged access and it uses TCP connect scan for insufficient privileges. The -Pn in the above commands is used for the PING parameter.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong> <\/h2>\n\n\n\n<p><span style=\"color: initial\">Nmap is a powerful tool used for networking and security auditing of networks. Nmap is helpful for quickly finding useful information about the networks, ports, hosts, and <a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-operating-system\/\" target=\"_blank\" rel=\"noreferrer noopener\">operating systems<\/a>. There are other settings of Nmap too that enhance its productivity. In this article, we discussed the features of Nmap and why it should be learned. Also, we saw its cheatsheet where we included some commonly used commands of Nmap. To expand your skills further, check out our<a href=\"https:\/\/www.mygreatlearning.com\/academy\"> free online courses<\/a> on cybersecurity and more.<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"frequently-asked-questions\"><strong>Frequently Asked Questions&nbsp;<\/strong><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1659412579840\"><strong class=\"schema-faq-question\"><strong>Why is the Nmap command used?<\/strong><\/strong> <p class=\"schema-faq-answer\">The Nmap commands are used for a number of reasons that include security configurations and network auditing. The major reason for using Nmap is that it helps to find out networks very quickly and no complex configurations are needed to do this. Nmap also supports commands and scripting which makes it very useful for network administrators.\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1659412595447\"><strong class=\"schema-faq-question\"><strong>How many commands are there in Nmap?<\/strong><\/strong> <p class=\"schema-faq-answer\">There is a number of commands in Nmap and the number differs from version to version. Also, commands can be joined to make another command which means the total number of commands can also be increased. However, there are 50+ commands available in Nmap.\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1659412608315\"><strong class=\"schema-faq-question\"><strong>Do hackers use Nmap?<\/strong><\/strong> <p class=\"schema-faq-answer\">The answer is Yes because Nmap can be used to gain access to uncontrolled ports on the network that may lead to providing access to the system. The hackers run the commands to get into the targeted system and can exploit the vulnerabilities of that system.\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1659412617343\"><strong class=\"schema-faq-question\"><strong>How do I scan an IP with Nmap?<\/strong><\/strong> <p class=\"schema-faq-answer\">To scan an IP, you must know the subnet you are connected to. The following command can be used to scan an IP with Nmap:<br\/>nmap 192.168.1.1<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1659412643445\"><strong class=\"schema-faq-question\"><strong>What is the Nmap tool?<\/strong><\/strong> <p class=\"schema-faq-answer\">Nmap is a very useful network scanning tool. Nmap is used to identify the devices connected to a network with the help of IP packets. It can also be used to get information about the services running on the network and the OS.\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1659412676866\"><strong class=\"schema-faq-question\"><strong>How to install Nmap Linux?<\/strong><\/strong> <p class=\"schema-faq-answer\">The following steps can be followed to install Nmap Linux:<br\/>1. First update the list of Ubuntu packages and you also need to make sure before you install the Nmap, that all the packages are up-to-date. The command can be used to update packages on Ubuntu:<br\/>sudo apt-get update<br\/>2. Now after updating all the packages, you can install Nmap by using the following command:<br\/>sudo apt-get install nmap<br\/>3. Finally, in order to check if it is successfully installed on your system or not, you may use the following command and it will give you the version details of Nmap if installed successfully.\u00a0<br\/>nmap \u2013version<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1659412708353\"><strong class=\"schema-faq-question\"><strong>What does Nmap do for Linux?<\/strong><\/strong> <p class=\"schema-faq-answer\">Nmap uses IP packets to find the devices connected to a network and it also provides information about the OS and the services running on it.\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1659412735139\"><strong class=\"schema-faq-question\"><strong>How do you run Nmap?<\/strong><\/strong> <p class=\"schema-faq-answer\">To run Nmap, you need to check if it is installed on your system or not by using the following command:<br\/>nmap \u2013version<br\/>If nmap is not installed, then you need to install it first and then you can run it by using the command below:<br\/>nmap [hostname] or nmap [ip-address]<br\/>You need to use the hostname or ip-address that you want to run Network Mapping.\u00a0\u00a0<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction&nbsp; Nmap is a tool used for network mapping and it is one of the most popular ethical hacking tools in the market. Nmap is used to discover free networks around you. Network administrators find Nmap very useful as they always need to map their networks.&nbsp; Hackers also started using Nmap for auditing networks and [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":70319,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[],"content_type":[],"class_list":["post-77533","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Top 8 Nmap Commands you Should Know<\/title>\n<meta name=\"description\" content=\"Nmap commands: In this guide, we are going to look at What Nmap is, Nmap commands, and some more useful information about Nmap.\u00a0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top 8 Nmap Commands you Should Know\" \/>\n<meta property=\"og:description\" content=\"Nmap commands: In this guide, we are going to look at What Nmap is, Nmap commands, and some more useful information about Nmap.\u00a0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-08T03:38:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-31T08:26:47+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"853\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Top 8 Nmap Commands you Should Know\",\"datePublished\":\"2023-11-08T03:38:44+00:00\",\"dateModified\":\"2025-12-31T08:26:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/\"},\"wordCount\":2112,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/cropped-cyber-forensics-2.jpg\",\"articleSection\":[\"Cybersecurity\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/\",\"name\":\"Top 8 Nmap Commands you Should Know\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/cropped-cyber-forensics-2.jpg\",\"datePublished\":\"2023-11-08T03:38:44+00:00\",\"dateModified\":\"2025-12-31T08:26:47+00:00\",\"description\":\"Nmap commands: In this guide, we are going to look at What Nmap is, Nmap commands, and some more useful information about Nmap.\u00a0\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412579840\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412595447\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412608315\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412617343\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412643445\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412676866\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412708353\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412735139\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/cropped-cyber-forensics-2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/cropped-cyber-forensics-2.jpg\",\"width\":640,\"height\":853,\"caption\":\"Nmap Commands\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cybersecurity\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cybersecurity\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Top 8 Nmap Commands you Should Know\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412579840\",\"position\":1,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412579840\",\"name\":\"u003cstrongu003eWhy is the Nmap command used?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The Nmap commands are used for a number of reasons that include security configurations and network auditing. The major reason for using Nmap is that it helps to find out networks very quickly and no complex configurations are needed to do this. Nmap also supports commands and scripting which makes it very useful for network administrators.\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412595447\",\"position\":2,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412595447\",\"name\":\"u003cstrongu003eHow many commands are there in Nmap?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"There is a number of commands in Nmap and the number differs from version to version. Also, commands can be joined to make another command which means the total number of commands can also be increased. However, there are 50+ commands available in Nmap.\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412608315\",\"position\":3,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412608315\",\"name\":\"u003cstrongu003eDo hackers use Nmap?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The answer is Yes because Nmap can be used to gain access to uncontrolled ports on the network that may lead to providing access to the system. The hackers run the commands to get into the targeted system and can exploit the vulnerabilities of that system.\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412617343\",\"position\":4,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412617343\",\"name\":\"u003cstrongu003eHow do I scan an IP with Nmap?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To scan an IP, you must know the subnet you are connected to. The following command can be used to scan an IP with Nmap:u003cbr\\\/u003enmap 192.168.1.1\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412643445\",\"position\":5,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412643445\",\"name\":\"u003cstrongu003eWhat is the Nmap tool?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Nmap is a very useful network scanning tool. Nmap is used to identify the devices connected to a network with the help of IP packets. It can also be used to get information about the services running on the network and the OS.\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412676866\",\"position\":6,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412676866\",\"name\":\"u003cstrongu003eHow to install Nmap Linux?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The following steps can be followed to install Nmap Linux:u003cbr\\\/u003e1. First update the list of Ubuntu packages and you also need to make sure before you install the Nmap, that all the packages are up-to-date. The command can be used to update packages on Ubuntu:u003cbr\\\/u003esudo apt-get updateu003cbr\\\/u003e2. Now after updating all the packages, you can install Nmap by using the following command:u003cbr\\\/u003esudo apt-get install nmapu003cbr\\\/u003e3. Finally, in order to check if it is successfully installed on your system or not, you may use the following command and it will give you the version details of Nmap if installed successfully.\u00a0u003cbr\\\/u003enmap \u2013version\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412708353\",\"position\":7,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412708353\",\"name\":\"u003cstrongu003eWhat does Nmap do for Linux?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Nmap uses IP packets to find the devices connected to a network and it also provides information about the OS and the services running on it.\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412735139\",\"position\":8,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/nmap-commands\\\/#faq-question-1659412735139\",\"name\":\"u003cstrongu003eHow do you run Nmap?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To run Nmap, you need to check if it is installed on your system or not by using the following command:u003cbr\\\/u003enmap \u2013versionu003cbr\\\/u003eIf nmap is not installed, then you need to install it first and then you can run it by using the command below:u003cbr\\\/u003enmap [hostname] or nmap [ip-address]u003cbr\\\/u003eYou need to use the hostname or ip-address that you want to run Network Mapping.\u00a0\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Top 8 Nmap Commands you Should Know","description":"Nmap commands: In this guide, we are going to look at What Nmap is, Nmap commands, and some more useful information about Nmap.\u00a0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/","og_locale":"en_US","og_type":"article","og_title":"Top 8 Nmap Commands you Should Know","og_description":"Nmap commands: In this guide, we are going to look at What Nmap is, Nmap commands, and some more useful information about Nmap.\u00a0","og_url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2023-11-08T03:38:44+00:00","article_modified_time":"2025-12-31T08:26:47+00:00","og_image":[{"width":640,"height":853,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Top 8 Nmap Commands you Should Know","datePublished":"2023-11-08T03:38:44+00:00","dateModified":"2025-12-31T08:26:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/"},"wordCount":2112,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg","articleSection":["Cybersecurity"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/","url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/","name":"Top 8 Nmap Commands you Should Know","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg","datePublished":"2023-11-08T03:38:44+00:00","dateModified":"2025-12-31T08:26:47+00:00","description":"Nmap commands: In this guide, we are going to look at What Nmap is, Nmap commands, and some more useful information about Nmap.\u00a0","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412579840"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412595447"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412608315"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412617343"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412643445"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412676866"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412708353"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412735139"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg","width":640,"height":853,"caption":"Nmap Commands"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Cybersecurity","item":"https:\/\/www.mygreatlearning.com\/blog\/cybersecurity\/"},{"@type":"ListItem","position":3,"name":"Top 8 Nmap Commands you Should Know"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412579840","position":1,"url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412579840","name":"u003cstrongu003eWhy is the Nmap command used?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The Nmap commands are used for a number of reasons that include security configurations and network auditing. The major reason for using Nmap is that it helps to find out networks very quickly and no complex configurations are needed to do this. Nmap also supports commands and scripting which makes it very useful for network administrators.\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412595447","position":2,"url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412595447","name":"u003cstrongu003eHow many commands are there in Nmap?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"There is a number of commands in Nmap and the number differs from version to version. Also, commands can be joined to make another command which means the total number of commands can also be increased. However, there are 50+ commands available in Nmap.\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412608315","position":3,"url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412608315","name":"u003cstrongu003eDo hackers use Nmap?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The answer is Yes because Nmap can be used to gain access to uncontrolled ports on the network that may lead to providing access to the system. The hackers run the commands to get into the targeted system and can exploit the vulnerabilities of that system.\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412617343","position":4,"url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412617343","name":"u003cstrongu003eHow do I scan an IP with Nmap?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"To scan an IP, you must know the subnet you are connected to. The following command can be used to scan an IP with Nmap:u003cbr\/u003enmap 192.168.1.1","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412643445","position":5,"url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412643445","name":"u003cstrongu003eWhat is the Nmap tool?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Nmap is a very useful network scanning tool. Nmap is used to identify the devices connected to a network with the help of IP packets. It can also be used to get information about the services running on the network and the OS.\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412676866","position":6,"url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412676866","name":"u003cstrongu003eHow to install Nmap Linux?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The following steps can be followed to install Nmap Linux:u003cbr\/u003e1. First update the list of Ubuntu packages and you also need to make sure before you install the Nmap, that all the packages are up-to-date. The command can be used to update packages on Ubuntu:u003cbr\/u003esudo apt-get updateu003cbr\/u003e2. Now after updating all the packages, you can install Nmap by using the following command:u003cbr\/u003esudo apt-get install nmapu003cbr\/u003e3. Finally, in order to check if it is successfully installed on your system or not, you may use the following command and it will give you the version details of Nmap if installed successfully.\u00a0u003cbr\/u003enmap \u2013version","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412708353","position":7,"url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412708353","name":"u003cstrongu003eWhat does Nmap do for Linux?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Nmap uses IP packets to find the devices connected to a network and it also provides information about the OS and the services running on it.\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412735139","position":8,"url":"https:\/\/www.mygreatlearning.com\/blog\/nmap-commands\/#faq-question-1659412735139","name":"u003cstrongu003eHow do you run Nmap?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"To run Nmap, you need to check if it is installed on your system or not by using the following command:u003cbr\/u003enmap \u2013versionu003cbr\/u003eIf nmap is not installed, then you need to install it first and then you can run it by using the command below:u003cbr\/u003enmap [hostname] or nmap [ip-address]u003cbr\/u003eYou need to use the hostname or ip-address that you want to run Network Mapping.\u00a0\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg",640,853,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2-225x300.jpg",225,300,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg",640,853,false],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg",640,853,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg",640,853,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2.jpg",640,853,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2-640x853.jpg",640,853,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2-96x96.jpg",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/cropped-cyber-forensics-2-150x200.jpg",150,200,true]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"Introduction&nbsp; Nmap is a tool used for network mapping and it is one of the most popular ethical hacking tools in the market. Nmap is used to discover free networks around you. Network administrators find Nmap very useful as they always need to map their networks.&nbsp; Hackers also started using Nmap for auditing networks and&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/77533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=77533"}],"version-history":[{"count":18,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/77533\/revisions"}],"predecessor-version":[{"id":114627,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/77533\/revisions\/114627"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/70319"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=77533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=77533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=77533"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=77533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}