Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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 ""
FIND: Parameter format not correct
  • Should I install anything while installing cygwin or am I doing something wrong?
share|improve this question

5 Answers 5

up vote 9 down vote accepted

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.

share|improve this answer
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

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.

share|improve this answer

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"
share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer


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