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

Linux slocate command

Linux Command Manual

Linux slocate command to find 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>][searched file]

Parameter:

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

Online Examples

Use the command 'slocate' to display the file path information containing the keyword 'fdisk', enter the following command:

$ slocate fdisk #Display the path information of files containing the keyword 'fdisk' 

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

$ slocate fdisk #Display the path information of files containing the keyword 'fdisk'  
/root/cfdisk        #List of search results 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