Linux "updatedb" Command Line Options and Examples
update a database for mlocate

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.


Usage:

updatedb [OPTION]...






Command Line Options:

-f
Add entries in white-space-separated list FS to PRUNEFS.
updatedb -f ...
-n
Add entries in white-space-separated list NAMES to PRUNENAMES.
updatedb -n ...
-e
Add entries in white-space-separated list PATHS to PRUNEPATHS.
updatedb -e ...
-U
Store only results of scanning the file system subtree rooted at PATH to the generated database. Thewhole file system is scanned by default.locate(1) outputs entries as absolute path names which don't contain symbolic links, regardless of theform of PATH.
updatedb -U ...
--debug-pruning
Write debugging information about pruning decisions to standard error output.
updatedb --debug-pruning ...
-h
Write a summary of the available options to standard output and exit successfully.
updatedb -h ...
-o
Write the database to FILE instead of using the default database.
updatedb -o ...
--prune-bind-mounts
Set PRUNE_BIND_MOUNTS to FLAG, overriding the configuration file.
updatedb --prune-bind-mounts ...
--prunefs
Set PRUNEFS to FS, overriding the configuration file.
updatedb --prunefs ...
--prunenames
Set PRUNENAMES to NAMES, overriding the configuration file.
updatedb --prunenames ...
--prunepaths
Set PRUNEPATHS to PATHS, overriding the configuration file.
updatedb --prunepaths ...
-l
Set the “require file visibility before reporting it” flag in the generated database to FLAG.If FLAG is 0 or no, or if the database file is readable by "others" or it is not owned by mlocate,locate(1) outputs the database entries even if the user running locate(1) could not have read thedirectory necessary to find out the file described by the database entry.If FLAG is 1 or yes (the default), locate(1) checks the permissions of parent directories of each entrybefore reporting it to the invoking user. To make the file existence truly hidden from other users,the database group is set to mlocate and the database permissions prohibit reading the database byusers using other means than locate(1), which is set-gid mlocate.Note that the visibility flag is checked only if the database is owned by mlocate and it is not read‐able by "others".
updatedb -l ...
-v
Output path names of files to standard output, as soon as they are found.
updatedb -v ...
-V
Write information about the version and license of locate on standard output and exit successfully.EXAMPLESTo create a private mlocate database as an user other than root, runupdatedb -l 0 -o db_file -U source_directoryNote that all users that can read db_file can get the complete list of files in the subtree of source_direc‐tory.FILES/etc/updatedb.confA configuration file. See updatedb.conf(5)./var/lib/mlocate/mlocate.dbThe database updated by default.SECURITYDatabases built with --require-visibility no allow users to find names of files and directories of otherusers, which they would not otherwise be able to do.NOTESThe accompanying locate(1) utility was designed to be compatible to slocate and attempts to be compatible toGNU locate where possible. This is not the case for updatedb.AUTHORMiloslav Trmac <mitr@redhat.com>
updatedb -V ...