On 26/2/2011, at 5:33pm, Grant wrote:
> 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'

$ mkdir -p  /my/folder
mkdir: cannot create directory `/my': Permission denied
$ mkdir -p my/folder
$ touch my/folder/foo.txt
$ find my/folder -type f -name '*foo*.txt'
my/folder/foo.txt
$ find /my/folder -name foo*.txt
find: `/my/folder': No such file or directory
$ ^/^
find my/folder -name foo*.txt
my/folder/foo.txt
$ 

> What am I doing wrong?  I do need the find to be recursive in that folder.

IMO the first thing you're doing wrong is concealing from us what you're 
actually doing.

You're telling us that `find /my/folder -name foo*.txt` and two other versions 
don't work, yet you're relying on us taking your word on it that they don't.

Prove it!

You could have done exactly as I did above and create a folder called 
"my/folder" and created a file called foo.txt and then copied and pasted from 
the terminal to show us your actual commands.

So we are only left to guess that the file you're looking for is NOT actually 
called "foo.txt" and it's NOT actually in a folder called "/my/folder". So the 
problem could be that you're looking for a file with a capital letter in its 
name, and that you're  using "-name" instead of "-iname", or it could be that 
you're searching the wrong directory tree, or it could be a bunch of other 
things. Permissions springs to mind.

But you'd rather waste our time in trying to conceal what you're looking for (I 
can only assume the file is called "Busty big sluts 3.avi") than help us help 
you.

Stroller.



Reply via email to