English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux slocate command

Linux Command Manual

Linux slocate command to search for files or directories.

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

Syntax

slocate [-u][--help][--version][-d <directory>][File to be searched]

Parameter:

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

Online Examples

Use the command "slocate" to display file path information containing the keyword "fdisk", input the following command:

$ slocate fdisk #Display file path information containing fdisk keyword 

After executing the above command, the output information of the command execution is as follows:

$ slocate fdisk #Display file path information containing fdisk keyword  
/root/cfdisk        #List of search found 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  

Linux Command Manual