GNU version of locate. |
locate | [-d path | --database=path ] [ -e | -E | --[non-]existing ] [ -i | --ignore-case ] [ -0 | --null ] [ -c | --count ] [ -l N | --limit =N] [ --version ] [ --help] |
updatedb
and outputs names that contain pattern
.
The databases entries includes all parent directories and /
and .
are not treated specially in pattern
.
If pattern
is a plain string (i.e. it contains no metacharacters),
all names that contain that string are output as if pattern
began and ended with *
.
For example: hive
is equivelent to *hive*
and
foo*bar
will match names containing fooMybar
as well as foo3/bar
and *duck*
can match a name that contains lake/.ducky
.
Pattern
s can contain shell-style metacharacters: *
, ?
, and []
(which may need to be quoted to protect them from shell expansion).
pattern
s including metacharacters may need to begin with *
(to match parent directories).
Output going to a terminal will have control characters escaped in the same way as the -print
action of find
-S --statistics |
Output statistics about the database and exit (unless --print or--count is present)
Database /var/cache/locate/locatedb is in the GNU LOCATE02 format. Locate database size: 929379 bytes All Filenames: 81656 File names have a cumulative length of 3741662 bytes. Of those file names, 132 contain whitespace, 0 contain newline characters, and 11 contain characters with the high bit set. Compression ratio 75.16% (higher is better) | ||||||||||||||||||||||||||
-w --wholename
| Compare whole name (including parent directories). default. | ||||||||||||||||||||||||||
-b --basename | only the final component of the name is compared. | ||||||||||||||||||||||||||
-l N |
LOCATE_PATH
Colon-separated list of databases to search.
BUGS
The locate database handles filenames containing newlines if the system's sort
suppports -z
.
If you suspect that locate may need to return filenames containing newlines, consider using --null
.
Use Savannah.gnu.org to submit bugs.
Join the bug-findutils mailing list, send email to tbug-findutils-request@gnu.org
updatedb - update a file name database for locate | GNU version |
updatedb
[options]
The file name databases contain lists of files that were in the directory when the databases were
last updated.
The name of the databases is determined when
locate
and updatedb
are configured . The frequency with
which the databases are updated and the directories for which they contain
entries depend on how often updatedb
is run, and with which arguments.
In networked environments, it often makes sense to build a database at the
root of each filesystem, containing the entries for that filesystem.
updatedb
is run for each filesystem on the fileserver where that
filesystem is on a local disk, to prevent thrashing the network. Users
can select which databases locate searches using an environment variable
or command line option; see locate
. Databases can not be concatenated
together.
--findoptions
=option1 -option2...
Global options to pass to find
.
The environment variable FIND‑OPTIONS
sets this value. Default is none
.
--localpaths
=/path1 path2...
Non-network directories to put in the database. Default is /
.
--netpaths
=path1 path2...
Network (NFS,
AFS,
RFS,
etc.) directories to put in the database.
The environment variable NETPATHS
sets this value. Default is
none
.
--prunepaths
=path1 path2...
Directories to exclude. ( no trailing slashes )
The environment variable PRUNEPATHS
sets this value. Default /tmp
/usr/tmp
/var/tmp /afs
.
--prunefs=path…
File systems to exclude.
The environment variable PRUNEFS
sets this value. Default is nfs NFS proc.
--output=dbfile
file to build, default is /var/cache/locate/locatedb
.
--localuser=user
The user to search non-network directories as, using su.
Default is to search the non-network directories as the current user.
The environment variable LOCALUSER
.
--netuser
=user
The user to search network directories as, using su. Default is
daemon
.
the environment variable NETUSER
.
--old-format
Create the database in the old format
--version
display the version number of updatedb and exit.
--help
display a summary of the options to updatedb and exit.
updatedb [-qv][--output=file]
-l level |
-z
option. If you suspect
that locate may need to return filenames containing newlines, consider
using --null
.