Gentoo Archives: gentoo-user

From: thelma@×××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] locate can not find a file
Date: Wed, 15 Mar 2017 15:50:54
Message-Id: 8097ec36-f867-143a-5ee5-5dc22a1f3e90@sys-concept.com
In Reply to: Re: [gentoo-user] locate can not find a file by Alarig Le Lay
1 On 03/15/2017 09:31 AM, Alarig Le Lay wrote:
2 > On mer. 15 mars 09:10:26 2017, thelma@×××××××××××.com wrote:
3 >> Yes, I run as root: updatedb
4 >> But when run:
5 >> locate consent_extraction*
6 >>
7 >> It only list one file:
8 >> /home/fd/consent_extraction1.pdf (this is a link file)
9 >> /home/fd/business/forms/consent_extraction1.pdf
10 >>
11 >> It can not find: "consent_extraction.pdf" both files are in same directory
12 >>
13 >> ll business/forms/
14 >> total 688
15 >> ...
16 >> -rw-r--r-- 1 fd fd 63032 Mar 15 08:52 consent_extraction1.pdf
17 >> -rw-r--r-- 1 fd fd 397649 Mar 14 20:05 consent_extraction.pdf
18 >>
19 >> I observe the same behaviour on my local machine and remote machine.
20 >>
21 >> Running "find" finds both files
22 >>
23 >> find . -name '*consent_extraction*'
24 >> ./business/forms/consent_extraction.pdf
25 >> ./business/forms/consent_extraction1.pdf
26 >> ./consent_extraction1.pdf
27 >>
28 >> Why?
29 >
30 > Hi,
31 >
32 > Do you have file consent_extraction1.pdf in your working directory? In
33 > that case, your shell will begin by expending your asterisk and you will
34 > really look for consent_extraction1.pdf.
35
36 It is a strange behaviour :-/
37 Yes, I had a link "consent_extraction1.pdf" in a working directory and
38 locate could only locate: consent_extraction1.pdf
39 It could not find: consent_extraction.pdf
40
41 When I removed "consent_extraction.pdf" from my working directory.
42 run "updatedb" and
43 "locate *consent_extraction*" found both files
44 "locate consent_extraction" found both files
45 "locate consent_extraction*" didn't find any files
46
47 The "*" is is messing up the search. I was under impression the "*" will
48 match any character including extensions.
49
50 --
51 Thelma

Replies

Subject Author
Re: [gentoo-user] locate can not find a file thelma@×××××××××××.com