On 24/11/2020 12:09, Patrick Shanahan wrote:
* Sakke K <sakke....@gmail.com> [11-24-20 12:01]:
locate is a faster command than find.
For example, locate _A250256.ORF.xmp

yes, find actively scans your file structure while locate just look into
its database.  but the database must be up-to-date or your locate will
fail.

RTFM
Just to clarify from TFM:
==============================================================================
locate(1) General Commands Manual
NAME
       locate - find files by name

SYNOPSIS
       locate [OPTION]... PATTERN...

DESCRIPTION
        locate  reads  one or more databases prepared by updatedb(8) and
        writes file names matching at least one of the PATTERNs to standard
        output, one per line.

        ...

        By  default,  locate does not check whether files found in database
        still exist (but it does require all parent directories to exist if
        the database was built with --require-visibility no).  locate  can
        never report files created after the most recent update of the relevant
        database.
===========================================================================

So if you've uploaded (or relocated after uploading to a scratch directory)
since the last update to the relevant databases, 'locate' is not going to be useful. 'find', by comparison deals with what is actually in the file system right now.

The man page on 'updatedb' says it is refreshed daily by 'cron', but on some systems it is done by a systemd timer unit.

Either way, it may not, on you system, be enabled by default.  It isn't on mine.
So I prefer to use 'find'. Which is more flexible about such matters time and size and the ability run subcommands such as 'exifgrep' on any potential match.


____________________________________________________________________________
darktable user mailing list
to unsubscribe send a mail to darktable-user+unsubscr...@lists.darktable.org

Reply via email to