Slocate itself has a database that stores information about files and directories in the system.
Syntax
Slocate [-u] [-- help] [-- version] [-d <Directory>] [searched file]
Parameters:
-
-D <Directory> or -- database = <Directory> specifies the directory where the database is located.
-
-U updates the slocate database.
-
-- Help: displays help.
-
-- Version: displays the version information.
Instance
Run the command "slocate" to display the file path information with the keyword "fdisk" in the file name. Enter the following command:
$ Slocate fdisk # display the path information of the file with the fdisk keyword in the file name
After the preceding command is executed, the command output is as follows:
$ Slocate fdisk # display the path information of the file containing the fdisk keyword in the file name/root/cfdisk # List of searched file paths/root/fdisk/root/sfdisk/usr/include/grub /ieee1275/ofdisk. h/usr/share/doc/util-Linux/README. cfdisk/usr/share/doc/util-Linux/README.fdisk.gz/usr/share/doc/util-Linux/examples/sfdisk.examples.gz