When trying to run find commands in cygwin, I keep getting the error
"FIND: Parameter format not correct"
However, the same commands run on linux. What's going on?
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
You're using the Windows find command, not cygwin's.
This is made clear if you type 'which find'
To fix it, edit your path (System Properties -> Advanced -> Environment Variables -> System Variables -> Path) and move the entry for cygwin to the front of the path. (An easy way to do this is to copy the whole path, paste it into Notepad edit it there, and paste it back).
As pointed out in the comments, another route is to edit the bash startup scripts and change the path there. I'd even say this is the preferred solution as I've now found a case in which having cygwins versions first caused a problem.
I couldn't get the correct 'find' to run when in the windows' command shell, and the PATH tweaking didn't help. But this worked:
bash /usr/bin/find . -iname blahblah* exit
The explicit path fired up the right 'find', and for whatever reason, works only when running in bash.