From: Merciadri Luca on
Tzafrir Cohen wrote:
> On Fri, Jun 11, 2010 at 12:18:58AM +0200, Merciadri Luca wrote:
>
>> Tzafrir Cohen wrote:
>>
>>> On Thu, Jun 10, 2010 at 10:58:58PM +0200, Merciadri Luca wrote:
>>>
>>>
>>> Others already mentioned location. I'll just note that 'find' and 'ls
>>> -lR' should have comparable speeds. find's output should be nicer to
>>> parse.
>>>
>>> A single 'find' is normally enough to cache the relevant directories.
>>>
>>>
>> Well, you first need to do _one_ find before for both to have the same
>> speed. That's the problem. Locate seems to do what I want.
>>
>
> That is, unless you're not really sure the relevant sub-tree is
> up-to-date and run updatedb, which is equivalent to 'find /' (with
> proper excludes).
>
>
Ok. Thanks for this confirmation.

--
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
I use PGP. If there is an incompatibility problem with your mail
client, please contact me.


It pays to pay attention.

From: John on
On Thu, Jun 10, 2010 at 5:06 PM, Merciadri Luca
<Luca.Merciadri(a)student.ulg.ac.be> wrote:
> `locate' is really, really, really, really faster. I had no knowledge
> about it. Thanks a lot.

Just remember, locate is much faster because it's reading a database.
Results from "find" reflect the state of your system NOW, and results
from "locate" reflect what your system was whenever the last database
update was run.

So locate will fail to find files that you just installed (after the
db update), and it can report files that are in fact no longer there
(deleted, or moved)!

I think people are recommending to use mlocate now, which is a dropin
replacement for locate. One big (HUGE) advantage is on db updates,
where mlocate looks at a directory to see if anything has changed,
whereas older locate recursively examined the contents of directories.

In any case, I agree with you, locate (which is still the command to
invoke even for mlocate) works great.

John


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/AANLkTimcsshflF1_s7bK4xS2hQi_rlUg4EuG856zqRXj(a)mail.gmail.com
From: Merciadri Luca on
John wrote:
> On Thu, Jun 10, 2010 at 5:06 PM, Merciadri Luca
> <Luca.Merciadri(a)student.ulg.ac.be> wrote:
>
>
> Just remember, locate is much faster because it's reading a database.
> Results from "find" reflect the state of your system NOW, and results
> from "locate" reflect what your system was whenever the last database
> update was run.
>
> So locate will fail to find files that you just installed (after the
> db update), and it can report files that are in fact no longer there
> (deleted, or moved)!
>
> I think people are recommending to use mlocate now, which is a dropin
> replacement for locate. One big (HUGE) advantage is on db updates,
> where mlocate looks at a directory to see if anything has changed,
> whereas older locate recursively examined the contents of directories.
>
> In any case, I agree with you, locate (which is still the command to
> invoke even for mlocate) works great.
>
Thanks.

--
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
I use PGP. If there is an incompatibility problem with your mail
client, please contact me.




From: Ron Johnson on
On 06/10/2010 03:58 PM, Merciadri Luca wrote:
> Hi,
>
> I find `find' very inefficient when trying to find some files. I prefer
> using `ls -alR | grep stuff' The problem is that the related output does
> not give me the directory where `stuff' is found. How can I add some row
> giving this? Thanks.
>

This might be useful to you. I wrote it while pining away for the
OpenVMS DIR command, after seeing how incredibly useless "ls -alR" is.

http://members.cox.net/ron.l.johnson/pydir

--
"There is usually only a limited amount of damage that can be
done by dull or stupid people. For creating a truly monumental
disaster, you need people with high IQs."
Thomas Sowell


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4C127B8F.2030509(a)cox.net
From: Merciadri Luca on
Ron Johnson wrote:
> On 06/10/2010 03:58 PM, Merciadri Luca wrote:
>
> This might be useful to you. I wrote it while pining away for the
> OpenVMS DIR command, after seeing how incredibly useless "ls -alR" is.
>
> http://members.cox.net/ron.l.johnson/pydir
>
Thanks. I'll try it.

--
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
I use PGP. If there is an incompatibility problem with your mail
client, please contact me.


When one door closes, another opens; but we often look so long and so
regretfully upon the closed door that we do not see the one which has
opened for us. (Alexander Graham Bell)