Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've read about the -oG and tried it out, but it seems to not to working for me... SO basically I'm trying to scan for a port range, lets say for example – and for a list of for open ports: 80, 8080, 8001, 8008. And the output should be ip and open port like this: 80 8080 80

I'm not at my PC at the moment so I can't remember the exact line I used to scan with nmap.

Best Regards

share|improve this question

migrated from Apr 30 '12 at 12:10

This question came from our site for professional and enthusiast programmers.

You should ask when you /are/ at your PC and /can/ check what you are actually trying and does not work. Also, seems to fit better on Security than SO. – Daniel Roethlisberger Apr 29 '12 at 11:01

The Grepable output option (-oG) is covered in the this section of the online version of Nmap Network Scanning. Like all the -o* output options, it takes a filename argument. Normal output will be displayed, but the Grepable output will be sent to the file named by the argument. As a special case, a file name of - can be used to send the Grepable output to the console instead of the normal output.

The output itself is different than you seem to be expecting, and is covered in depth on Nmap's web site. It's important to note that when parsing Nmap's output with another program, the XML output (-oX) is recommended, since it contains all the information gathered in the scan. Grepable output is deprecated, and so is missing (among other things) traceroute information and script output.

share|improve this answer

the -oG option takes an extra argument of an output filename

this could be an actual file, or a hyphen (-) which is the standard output (the console)

This command works as expexted, printing to the screen

nmap -oG - -p80,8080,8001,8008
share|improve this answer

You must log in to answer this question.