I’m having a minor brain-fart that I’m sure someone can answer quickly. I’m using cygwin to get a bash shell in windows (in case that has any idiosyncrasies) and am having trouble shifting a regular expression between ls and find.
I have a bunch of files that I need to access, some which start EA_ and some which start FS_ so I can list them with ls like this
ls -l {EA,FS}_*
and this also works fine with wc but when I try to use this in a find, the regex doesn’t seem to be right:-
find . -iname "{EA,FS}_*"
I’ve tried escaping the { and } but that doesn’t seem to work either – what am I doing wrong?
Cheers
MH
Looks like you need a regular expression instead of the usual name glob:
Remember with this syntax that you have to match the directory too. From your commands it looks like you’re doing it all in one directory (no depth) so what I’ve provided will work. For more recursive searches you’d need a different regex.
Test run on Cygwin, Windows 7: