Nmap for Beginners · lesson 6 · 2026-08-21 · updated 2026-10-12
Nmap for Beginners: Save & Read Your Scan Results (-oN, -oA)
Before you start
- A Kali Linux machine or VM (Nmap is preinstalled).
- Internet access: the lesson scans
scanme.nmap.org, a host the Nmap project provides for test scans. - A writable working folder: the lesson saves
firstscan.txtandmyscan.*in the current directory. - Only test systems you own or are authorized to test.
Welcome back to The Exploit HQ. This is part six of our beginner Nmap series, and, as always, you need zero experience to follow along.
Let’s remember how far you have come. You have found the open doors on a computer, learned what software sits behind them, learned what open, closed, and filtered mean, scanned a whole home network, and made your scans faster and more focused.
Today we learn one last, very practical skill. Saving your results to a file, so you can keep them, share them with someone, compare them later, or drop them into a report.
This matters, because until now every scan has vanished the moment we closed the window. A real professional keeps a record. Once you can save and re-read your scans, you are working like the pros do.
As always, we begin at the very start. Open the terminal window.
And remember, when you see the prompt, the short line that ends in a dollar sign, the computer is ready for you to type.
Up to now, our scan results have only appeared on the screen. Let’s run one more scan, but this time, ask Nmap to also save it into a file.
The magic is one small flag, dash, o, capital N. Think of the o as, output, meaning where the results go. And the capital N stands for, normal. That is the friendly, human-readable report, exactly the kind you have been reading all series.
After the flag, we simply give the file a name of our choosing. Let’s call ours, firstscan dot txt. The dot txt just means it is a plain text file.
nmap, space, dash o capital N, space, firstscan dot txt, space, scanme dot nmap dot org, and press Enter.
nmap -oN firstscan.txt scanme.nmap.org
Now notice something lovely. The scan still printed on the screen, exactly as before. But quietly, in the background, Nmap also wrote a copy of that report into our file, firstscan dot txt. Nothing looked different, yet the result is now saved.
So how do we read a saved file back? With a tiny, everyday command called, cat. Cat simply means, show me what is inside this file, and print it right here on the screen.
cat, space, firstscan dot txt, and press Enter.
cat firstscan.txt
There it is. The very same report we just saw, now living safely in a file. And look, Nmap even added two extra lines at the top and bottom, with the exact date and time of the scan. That is a free record of when you ran it.
Let’s prove the file is really there, with another simple command, ls. That is l, s, and it means, list, show me the files. We will point it at just our file, to keep things tidy.
ls, space, dash l, space, firstscan dot txt, and press Enter.
ls -l firstscan.txt
There is our file, with its size and the time it was made. A small tip. Give your scan files clear names, like the date, or the thing you scanned, so that future you knows exactly what each one is.
Now, the normal report is not the only way to save. Nmap offers a few formats, each for a different job, and they are worth knowing about.
There is dash o capital G, the greppable format, which squeezes each computer onto a single line, so it is easy to search through later. And there is dash o capital X, the X M L format, which is meant for other programs to read, not really for us humans.
Now here is the delightful shortcut. Instead of choosing one, you can save all of them at once, with dash o capital A. The capital A stands for, all. You give it just one base name, and Nmap writes every format for you.
nmap, space, dash capital F, space, dash o capital A, space, my scan, space, scanme dot nmap dot org, and press Enter.
nmap -F -oA myscan scanme.nmap.org
We even reused dash capital F from part five, to keep it quick. Now let’s see what Nmap saved for us. We will list every file that starts with, my scan, using a star to mean, anything.
ls, space, dash l, space, my scan, dot, star, and press Enter.
ls -l myscan.*
Three files, from one command. The dot nmap file is our normal readable report. The dot gnmap file is the greppable, one-line-per-computer version. And the dot xml file is for other tools. One scan, saved three ways, ready for whatever you need next.
And our golden rule, always. Only scan a computer you own, or one you have clear permission to test. Our practice server, scanme dot nmap dot org, is offered by the Nmap Project exactly for this, so it is always safe to use.
Let’s go over what you learned today.
Dash o capital N saves the normal, readable report to a file. Cat reads any file back onto the screen. ls lists your files so you can find them. And dash o capital A saves every format at once, from a single command.
And with that, you have a complete beginner’s toolkit for scanning. You can find the open doors, see the software behind them, read the port states, scan a whole network, focus and speed up your scans, and now, keep a professional record of everything you find.
Practice these gently on the safe server, and let them become second nature. That habit of saving your work is what separates someone just poking around from someone doing this properly.
Thanks for learning with The Exploit HQ. Keep that terminal open, keep practicing, and I will see you in the next one.