nmap with Cygwin

As of this writing, nmap is not built-in to Cygwin. Here is how to install and configure nmap so that you can call nmap seamlessly from Cygwin:

1) Download and install the “self-installer” from


You do NOT need the WinPCap services, I unchecked those options.

2) in cygwin, type nano .bash_profile and add the line:
alias nmap="/cygdrive/c/Program\ Files\ \(x86\)/Nmap/nmap.exe"

3) close and reopen your Cygwin window

Now, when you type nmap in Cygwin terminal you should now see the nmap help text.

Using nmap to determine which IPs are active on a subnet

Example: you have a router that puts all devices with IP addresses 192.168.1.xxx where xxx is a number between 1 to 255.

nmap -v -sn | grep -B1 up
will tell you the IP addresses that are active on that subnet.

-v: verbose
-sn: just scan if active PC available (ping scan)

It is possible that some devices will hide themselves from this scan, but it’s handy for finding a new device that attached to your network.