Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Search filesystem with a wildcard
Date: Sun, 27 Feb 2011 04:07:30
Message-Id: C7BA3227-4CF9-4525-99C7-1C31DA110744@stellar.eclipse.co.uk
In Reply to: Re: [gentoo-user] Search filesystem with a wildcard by Grant
1 On 26/2/2011, at 5:33pm, Grant wrote:
2 > I can't get find to work. This works:
3 >
4 > locate *foo*.txt
5 >
6 > but none of these work:
7 >
8 > find /my/folder -name foo*.txt
9 > find /my/folder -name *foo*.txt
10 > find /my/folder -type f -name '*foo*.txt'
11
12 $ mkdir -p /my/folder
13 mkdir: cannot create directory `/my': Permission denied
14 $ mkdir -p my/folder
15 $ touch my/folder/foo.txt
16 $ find my/folder -type f -name '*foo*.txt'
17 my/folder/foo.txt
18 $ find /my/folder -name foo*.txt
19 find: `/my/folder': No such file or directory
20 $ ^/^
21 find my/folder -name foo*.txt
22 my/folder/foo.txt
23 $
24
25 > What am I doing wrong? I do need the find to be recursive in that folder.
26
27 IMO the first thing you're doing wrong is concealing from us what you're actually doing.
28
29 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.
30
31 Prove it!
32
33 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.
34
35 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.
36
37 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.
38
39 Stroller.

Replies

Subject Author
Re: [gentoo-user] Search filesystem with a wildcard Grant <emailgrant@×××××.com>