5

I have the full gnuwin32 installation on my Win7 box. From the shell (cmd.exe), I can execute

c:\gnuwin32\bin\find.exe .

from a directory and get a list of all the files recursively. What I am trying to do is find all files with filenames ending in .rej. I would expect one of these to work:

c:\gnuwin32\bin\find.exe . -name "*.rej"
c:\gnuwin32\bin\find.exe . -name '*.rej'

but the first one only gives me one result (in the working directory), and the second gives me no results. In contrast,

ls -R | grep rej$

gives me many, many results ending in .rej. What am I missing?

Andrew
  • 215
  • 1
  • 4
  • 14
  • 2
    If you don't have any other criteria, you could just run from the command line: dir *.rej /s/b – jftuga Jul 19 '11 at 17:09
  • @jftuga Thanks -- I'll keep that in mind. In this case, I do need to do something with the files, though I can still use xargs in some incarnation, I'm sure. – Andrew Jul 19 '11 at 17:29
  • See also https://stackoverflow.com/questions/3995493/gnuwin32-find-exe-expands-wildcard-before-performing-search. No definitive answer there though... – mwfearnley Jan 27 '21 at 12:27

1 Answers1

1

I never found a good answer regarding anything I can do to make gnuwin32 find work, but I found this answer with a workaround. Specifically, using the nearly-decade-old find.exe from UnxUtils seems to work.

Andrew
  • 215
  • 1
  • 4
  • 14