updatedb (8) Linux Manual Page
updatedb – update a database for mlocate
Synopsis
updatedb [OPTION]…
Description
updatedb creates or updates a database used by locate(1). If the database already exists, its data is reused to avoid rereading directories that have not changed. updatedb is usually run daily by cron(8) to update the default database.
Exit Status
updatedb returns with exit status 0 on success, 1 on error.
Options
The PRUNE_BIND_MOUNTS, PRUNEFS, PRUNENAMES and PRUNEPATHS variables, which are modified by some of the options, are documented in detail in updatedb.conf(5).
-f,–add-prunefsFS- Add entries in white-space-separated list FS to
PRUNEFS. -n,–add-prunenamesNAMES- Add entries in white-space-separated list NAMES to
PRUNENAMES. -e,–add-prunepathsPATHS- Add entries in white-space-separated list PATHS to
PRUNEPATHS. -U,–database-rootPATH- Store only results of scanning the file system subtree rooted at PATH to the generated database. The whole file system is scanned by default.
locate(1) outputs entries as absolute path names which don’t contain symbolic links, regardless of the form of PATH. –debug-pruning- Write debugging information about pruning decisions to standard error output.
-h,–help- Write a summary of the available options to standard output and exit successfully.
-o,–outputFILE- Write the database to FILE instead of using the default database.
–prune-bind-mountsFLAG- Set
PRUNE_BIND_MOUNTSto FLAG, overriding the configuration file. –prunefsFS- Set
PRUNEFSto FS, overriding the configuration file. –prunenamesNAMES- Set
PRUNENAMESto NAMES, overriding the configuration file. –prunepathsPATHS- Set
PRUNEPATHSto PATHS, overriding the configuration file. -l,–require-visibilityFLAG- Set the “require file visibility before reporting it” flag in the generated database to FLAG.
If FLAG is
0orno, or if the database file is readable by "others" or it is not owned bymlocate,locate(1) outputs the database entries even if the user runninglocate(1) could not have read the directory necessary to find out the file described by the database entry.If FLAG is
1oryes(the default),locate(1) checks the permissions of parent directories of each entry before reporting it to the invoking user. To make the file existence truly hidden from other users, the database group is set tomlocateand the database permissions prohibit reading the database by users using other means thanlocate(1), which is set-gidmlocate.Note that the visibility flag is checked only if the database is owned by
mlocateand it is not readable by "others". -v,–verbose- Output path names of files to standard output, as soon as they are found.
-V,–version- Write information about the version and license of
locateon standard output and exit successfully.
Examples
To create a private mlocate database as an user other than root, run
updatedb -l 0 -odb_file-Usource_directory
Note that all users that can read db_file can get the complete list of files in the subtree of source_directory.
Files
/etc/updatedb.conf- A configuration file. See
updatedb.conf(5). /var/lib/mlocate/mlocate.db- The database updated by default.
Security
Databases built with –require-visibility no allow users to find names of files and directories of other users, which they would not otherwise be able to do.
Notes
The accompanying locate(1) utility was designed to be compatible to slocate and attempts to be compatible to GNU locate where possible. This is not the case for updatedb.
Author
Miloslav Trmac <mitr [at] redhat.com>
See Also
locate(1), mlocate.db(5), updatedb.conf(5)
