updatedb

Create or update the database files necessary for the slocate command

Supplementary instructions

updatedb command is used to create or update the database files necessary for the slocate command. The execution process of the updatedb command is long because it traverses the directory tree of the entire system and writes all file information into the slocate database file.

Additional explanation: slocate itself has a database that stores information about files and directories in the system.

grammar

updatedb(option)

Options

-o<file>: Ignore the default database file and use the specified slocate database file;
-U<directory>: Update the slocate database of the specified directory;
-v: Display the detailed process of execution.

Example

Use the -U option of the updatedb command to specify the directory to update the slocate database.

updatedb -U /usr/local/ updates the slocate database of the specified command