Take the 2-minute tour ×
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
bootstrap.jar
catalina-tasks.xml
catalina.bat
catalina.sh
commons-daemon-native.tar.gz
commons-daemon.jar
cpappend.bat
digest.bat
digest.sh
setclasspath.bat
setclasspath.sh
shutdown.bat
shutdown.sh
startup.bat
startup.sh
tomcat-juli.jar
tomcat-native.tar.gz
tool-wrapper.bat
tool-wrapper.sh
version.bat
version.sh

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

4 Answers 4

up vote 8 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

Your Answer

 
discard

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