Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 need to work with a script that uses the ping command with its ordinary Linux syntax, neither Cygwin's default package or the Windows ping utility will work. For now, I've patched the script to use the Windows version (with some difficulty; the Windows executable doesn't provide useful return codes so I have to parse the output), but I'd like the out-of-the-box compatibility and additional features of the Linux ping. Before I get any further, let me state that I am running Cygwin in administrator mode; it's not a privilege issue. It's a versions issue.

Cygwin's default ping command is listed as being version '1.0-1' in the setup manager, in the package 'ping: a basic network tool to test IP network connectivity'. With no arguments, it outputs:

Usage:  ping [-dfqrv] host [packetsize [count [preload]]]

and the man page description begins with "The DARPA Internet is a large and complex aggregation of network hardware,", which reads as more than a little out of date to me. This is the version installed in /bin/ping.

Windows' ping command is located at $SYSTEMROOT/system32/ping, and outputs the following message on invocation without parameters.

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
        [-r count] [-s count] [[-j host-list] | [-k host-list]]
        [-w timeout] target_name

This is certainly a more feature-rich ping (notably, it includes timeouts, which is important to me), but it's not the version available on a modern Linux install:

ping [ -LRUbdfnqrvVaAB] [ -c count] [ -i interval] [ -l preload] [ -p pattern] 
     [ -s packetsize] [ -t ttl] [ -w deadline] [ -F flowlabel] [ -I interface] 
     [ -M hint] [ -Q tos] [ -S sndbuf] [ -T timestamp option] [ -W timeout] 
     [ hop ...] destination

documented online here. I can't seem to find references to the cygwin version of ping except in reference to Cygwin.

I found this ancient email thread which describes an early version of Cygwin without ping. I have not found any version of iputils designed for Windows.

share|improve this question

You could either

  • try to build ping from source, it's part of the iputils package. But building stuff on cygwin can be quite the hassle.

Or (and I would try this first)

share|improve this answer
Thanks, it looks like the first option is going to work better for me as one of the desired requirements is that it have the syntax of the iputils version, so trying yet another ping implementation won't help. That said, I doubt that I'm the first to have run into this so I'll wait in case someone's already tried it. – Kevin Vermeer Aug 16 '12 at 21:25
By the way, iputils hasn't released a tagged in almost two years, but there's been some development for support of IPv6 in their git repository, which was a little hard to find but is located at ` git://`. Hope that helps someone. I'll post the patch to when I'm done with this, there's a fair bit of work to be done but it doesn't seem insurmountable. – Kevin Vermeer Aug 16 '12 at 21:51
If you get anywhere with building iputils for Cygwin, I strongly suspect the rest of the Cygwin community would love to get at it too. – me_and Aug 17 '12 at 13:14
@me_and - I would definitely release it if I succeed. However, while the first few files compiled just fine by simply changing #include <linux/filename.h> to #include <cygwin/filename.h> and the like, I later found that the Cygwin socket drivers are also lacking features needed by iputils. It's not just a matter of building iputils for Cygwin, it's also a matter of building Cygwin to work with iputils. I'll give it a go later if I have some spare time. – Kevin Vermeer Aug 17 '12 at 15:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.