Report issue Add example

slocate

Command to find files or directories using a database.

Description

The slocate command (Secure Locate) is used to find files or directories. slocate maintains a database that stores information about files and directories on the system.

Syntax

slocate [-u][--help][--version][-d <directory>][file]

Options

-d<directory> or --database=<directory>: Specify the directory where the database is located.
-u: Update the slocate database.
--help: Display help information.
--version: Display version information.

Example

Use the "slocate" command to display path information for files whose names contain the keyword "fdisk":

$ slocate fdisk # Display path information for files containing the keyword "fdisk"

The output will be similar to the following:

$ slocate fdisk
/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