Scan how many Linux and Windows hosts in Network with Nmap

Scan how many Linux and Windows hosts in Network with Nmap

Example 1:

[root@localhost ~]# nmap -F -O 192.168.129.1-255 | grep “Running: ” > /tmp/nmap; echo “$(cat /tmp/nmap | grep Linux | wc -l) Linux host(s)”; echo “$(cat /tmp/nmap | grep Windows | wc -l) Window(s) hosts”
0 Linux host(s)
2 Window(s) hosts
[root@localhost ~]#

Example 2:

[root@localhost ~]# nmap -F -O 10.3.12.1-254 | grep “Running: ” > /tmp/nmap; echo “$(cat /tmp/nmap | grep Linux | wc -l) Linux host(s)”; echo “$(cat /tmp/nmap | grep Windows | wc -l) Window(s) hosts”
7 Linux host(s)
0 Window(s) hosts
[root@localhost ~]#

That’s all. Thanks for using IThelpblog.com

Tags:  

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>