> >> I used to use slocate like this to search the filesystem for a file:
> >>
> >> foo*.txt
> >>
> >> but mlocate doesn't seem to accept wildcards.  I tried to figure out
> >> how to do it with find but failed.  Can anyone point me in the right
> >> direction?
> >>
> >> - Grant
> >
> > How about this?
> >
> > find -name foo*.txt ?
> 
> I can't get find to work.  This works:
> 
> locate *foo*.txt
> 
> but none of these work:
> 
> find /my/folder -name foo*.txt
> find /my/folder -name *foo*.txt
> find /my/folder -type f -name '*foo*.txt'
> 
> What am I doing wrong?  I do need the find to be recursive in that folder.


Don't you have some unfortunate alias set up for 'find'? I understand
you already have a working solution, but something's fishy here indeed.
The third one should absolutely work.

By the way, you should probably use quotes with 'locate' too. It might
cause the same kind of unexpected fail in case there happens to be
something which satisfies *foo*.txt in the working directory of the
command.

-rz

Reply via email to