← 返回命令列表

Linux command

updatedb 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Refresh

sudo updatedb

Verbose

sudo updatedb -v

说明

updatedb creates or updates the database used by the locate command. It scans the filesystem and builds an index of all filenames for fast searching. The command is usually run daily by cron to keep the database current. Manual execution is needed to index newly created files before the next scheduled update.

参数

-v, --verbose
Display filenames as they are found
--prunepaths _PATHS_
Exclude specified paths from database
--prunefs _TYPES_
Exclude specified filesystem types
-o, --output _FILE_
Write to specified database file
-U, --database-root _PATH_
Store only results from the subtree rooted at PATH
-e, --add-prunepaths _PATHS_
Add entries to PRUNEPATHS
-n, --add-prunenames _NAMES_
Add entries to PRUNENAMES
-l, --require-visibility _FLAG_
Control visibility checking (0 or 1)
--prune-bind-mounts _FLAG_
Override bind mount pruning (yes or no)

FAQ

What is the updatedb command used for?

updatedb creates or updates the database used by the locate command. It scans the filesystem and builds an index of all filenames for fast searching. The command is usually run daily by cron to keep the database current. Manual execution is needed to index newly created files before the next scheduled update.

How do I run a basic updatedb example?

Run `sudo updatedb` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -v, --verbose do in updatedb?

Display filenames as they are found