bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: limiting the directory to locate and search by file type


From: James Youngman
Subject: Re: limiting the directory to locate and search by file type
Date: Tue, 8 Nov 2011 09:40:35 +0000

On Tue, Nov 8, 2011 at 12:11 AM, Peng Yu <address@hidden> wrote:
> On Mon, Nov 7, 2011 at 5:47 PM, James Youngman <address@hidden> wrote:
>> You can achieve this by using locate --regex.
>
> Suppose I want to restrict the search to /tmp, what regex I should specify?

locate --regex '^/tmp\($\|/\)'

... but most distributions don't index /tmp.  Check your system's crontab.

> Doing file test will be slow, as I think that the point of locate is
> to avoid accessing the filesystem to speedup. Is there any development
> on adding filetype information to the database so that it will
> searchable within the database.

I'm not working on it right now.   But I think that it's a good idea
to move in this direction (and caching directory-level information
will also probably allow us to speed up indexing).  Would you like to
work on this?

James.

--
This email is intended solely for the use of its addressee, sender,
and any readers of a mailing list archive in which it happens to
appear.   If you have received this email in error, please say or type
three times, "I believe in the utility of email disclaimers," and then
reply to the author correcting any spellings (and, optionally, any
incorrect spellings), accompanying these with humorous jests about the
author's parentage.   If you are not the addressee, you are
nevertheless permitted to both copy and forward this email since
without such permissions email systems are unable to transmit email to
anybody, intended recipient or not.  To those still reading by this
point, the author would like to apologise for being unable to maintain
a consistent level of humour throughout this disclaimer.  Contents may
settle during transit.  Do not feed the animals.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]