I'm very new to Nmap. I'm using Nmap to find open ports of an IP by this command:
nmap -v -Pn -p 1-100 "$ip" -oG -
Here is the output:
Host: IP Ports: 6/closed/tcp/unknown 19/closed/tcp/chargen 20/closed/tcp/ftp-data 21/open/tcp/ftp 22/closed/tcp/ssh 23/closed/tcp/telnet 25/open/tcp/smtp 32/closed/tcp/unknown 50/closed/tcp/re-mail-ck 53/closed/tcp/domain 56/closed/tcp/xns-auth 62/closed/tcp/acas 68/closed/tcp/dhcpc 72/closed/tcp/netrjs-2 76/closed/tcp/deos 80/open/tcp//http 100/closed/tcp//newacct Ignored State: filtered (83)
As you see there are some closed ports in the result too. How can I change my command so that only open ports are displayed?