| bsd version | linux Version |
locate [-icms0 S] [-l limit] [-d database] filename-pattern …
Search database ( built periodically )
for all pathnames which match filename-pattern.
Shell globbing and quoting characters (*, ?, \, [ and ]) used in filename-pattern
must be escaped by preceding them with a backslash (\)
Matching differs from normal regex in that no characters must be matched explicitly, including slashes (/).
A filename-pattern containing no globbing characters is matched if the name contains the pattern.
-i |
Filenames contain any character except newline (\n) and NUL (00).
$HOME/lib/myLocatedb and then in the default system database:
$ locate -d $HOME/lib/myLocatedb: foo
First search $HOME/lib/myLocatedb then the default, then /var/db/locate.database then
$ locate -d $HOME/lib/mydb::/cdrom/locate.database foo
/cdrom/locate.database.
$ locate -d db1 -d db2 -d db3 patternis the same as
$ locate -d db1:db2:db3 patternor
$ locate -d db1:db2 -d db3 pattern
$LOCATE_PATH database, ignored if -d was specified.
/var/db/locate.database system default locate database/usr/libexec/locate.updatedb Script to update the locate database/System/Library/LaunchDaemons/com.apple.locate.plist Job that starts the database rebuild
/System/Library/LaunchDaemons/com.apple.locate.plist job.
The locate utility does not recognize multibyte characters.
/System/Library/LaunchDaemons/com.apple.locate.plist
key= Label com.apple.locate
key= Disabled false/
key= ProgramArguments /usr/libexec/locate.updatedb
key= LowPriorityIO true/
key= Nice integer= 5
key= KeepAlive dict= key= PathState dict= key= /var/db/locate.database false
key= StartCalendarInterval
key= Hour integer= 3 key= Minute integer= 15 key= Weekday integer= 6
key= AbandonProcessGroup true
and is protected by SIP.
Script /usr/libexec/locate.updatedb which invokes locate.mklocatedb and locate. bigram