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] [-w | --wholename] | [-b | --basename] |
[-S | --statistics ] [ -r | --regex ] [ -P | | -H | --nofollow ] [ -L | --follow ] [ -A | --all ] [ -p | --print ] | pattern …
|
Searches databases of file names created by 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.
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.
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 ($FIND-OPTIONS ). Default is none .
--localpaths =/path1 path2 …
Local directories to include. Default is | / .
--localuser=user The | user ( $LOCALUSER )
to search local directories as, using su.Default is the current user. --netpaths =path1 path2 ….
Network ( | NFS, AFS, RFS, etc.) directories to include (
$NETPATHS . Default is none .
--netuser =user
The user to search network directories as, using su
( | $NETUSER ).Default is daemon . If the user does not have sufficient access a partial database will be updated. --prunepaths =path1 path2 …
Directories to exclude, no trailing slashes ( | $PRUNEPATHS )Default /tmp /usr/tmp /var/tmp /afs .
--prunefs=path… File systems to exclude. | ( $PRUNEFS ) . Default is nfs NFS proc.
--output=dbfile Name of database , default is | /var/cache/locate/locatedb .
--old-format Create the database in the old format
| --version display the version of | updatedb and exit. | --help |
updatedb [-qv][--output=file]
-l level |
-z
option. If you suspect
that locate may need to return filenames containing newlines, consider
using --null
.