Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending nmap output to a file without also printing it to standard output

I am invoking nmap with the following command:

nmap -oX i.xml -p 1-1023 -r -T4 -d -d  

Doing this sends output to i.xml successfully. However, text is still printed on the command line in additional being redirected to i.xml. I would like the command to run silently on the command line, but to still write all of its output to my i.xml file. I tried using the -v0 argument, but using it results in neither my XML file nor the command line seeing any output.

How can I tell nmap to send its output only to my XML file?

like image 947
user1486918 Avatar asked Nov 22 '25 13:11

user1486918


1 Answers

Have you tried redirecting stdout to the null device?

nmap -oX i.xml -p 1-1023 -r -T4 -d -d >/dev/null

On Windows, use NUL instead of /dev/null

like image 87
Fred Sobotka Avatar answered Nov 25 '25 09:11

Fred Sobotka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!