I am using cygwin in my windows machine. I am trying to do a find and it is giving parameter format not correct. Why is that?

$ ls

$ find . -name "version.sh"
FIND: Parameter format not correct
  • Should I install anything while installing cygwin or am I doing something wrong?

Your PATH is bad. It has Windows system directories before Cygwin directories, or maybe doesn't have Cygwin directories at all. This message comes from the Windows command find (that it reports its name as FIND in uppercase is a hint).

When you start a Cygwin shell, you usually need to set the PATH. I recommend that you start a login shell (if I recall correctly, that's what the default Cygwin system menu entries do). Your Cygwin PATH should have /usr/local/bin, /usr/bin and /bin (at least) ahead of any non-Cygwin directory.

  • 1
    Yup, that's probably it. This error is because the find you used is Windows's find command, not cygwin's one. – Yanick Girouard May 2 '12 at 23:51
  • Or type /usr/bin/find instead of find – user39968 May 27 '13 at 18:24
  • I've had /usr/bin in the path, I guess the shell uses the first find found in the $PATH, which is the system one. I was about to remove it (because I didn't need it anyway), but I guess some random system scripts might expect just this find. So, fixing this the right way is to write an alias alias find="/usr/bin/find" into ~/.bashrc (or whatever shell you're using). – Hi-Angel Oct 31 '16 at 8:57

Is find installed? What does "which find" return? Remember that Windows has a built-in command line find that Cygwin would end up using if its own find is mia.


The answer from Gilles is correct in that the Windows version of the find command comes before the cygwin version, and so that is being called.

Putting Cygwin ahead however will mean that any batch files that use the windows find command will now actually call the cygwin find command, which may not be what you want.

The most symbiotic way for both to work, in my opinion, is to do the below:

  1. Locate the cygwin find command and rename/copy it to lfind.exe (or any other name that isn't onthe windows PATH)
  2. In your ~/.bashrc file add the line alias find=lfind

This way, when you run find from the cygwin terminal you will use the cygwin version, but batch files will use the windows version.

Note: You'll still need the cygwin bin directory on your PATH, but it can now be further back from the windows system directory.


When you're installing Cygwin, it doesn't install all the possible packages unless you ask it to. In order to add a desired package, take a look at the explanation here on Super User.

Or just perform the following actions:

  1. Start Setup, select a mirror, and get to the packages screen
  2. Select "Keep" from the radio button list at the top
  3. Select the desired package under the relevant group
  4. Select "Continue"

Here are the GNU-utils as native win32 ports. They don't need cygwin to be run, and come with a shell (sh.exe), including grep, sed, awk, find, less, cat, tac, and much more.

The problem with the Windows path will persist, but maybe you rename the find to gfind (gnu-find) or to search, to make it more easily accessible, and add the coreutils dir to your PATH.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy