1 |
on 2011-02-26 at 09:33 Grant wrote: |
2 |
|
3 |
>I can't get find to work. This works: |
4 |
> |
5 |
>locate *foo*.txt |
6 |
> |
7 |
>but none of these work: |
8 |
> |
9 |
>find /my/folder -name foo*.txt |
10 |
>find /my/folder -name *foo*.txt |
11 |
>find /my/folder -type f -name '*foo*.txt' |
12 |
> |
13 |
>What am I doing wrong? I do need the find to be recursive in that folder. |
14 |
|
15 |
|
16 |
i'm sorry i haven't been following the thread too closely, but the last |
17 |
one should work. according to man find, when using wildcards in a search, |
18 |
"you should enclose the pattern in quotes or escape the wildcard", meaning |
19 |
that all these work: |
20 |
|
21 |
find /my/folder -type f -name "*foo*.txt" |
22 |
find /my/folder -type f -name '*foo*.txt' |
23 |
find /my/folder -type f -name \*foo\*.txt |
24 |
|
25 |
they certainly work for me. am i missing something? |