Linux slocate command
The Linux slocate command finds files or directories.
slocate itself has a database that stores information about files and directories in the system.
Syntax
slocate [-u][--help][--version][-d <目录>][查找的文件]
Parameters:
- -d
or --database= Specify the directory where the database is located. - -u Update the slocate database.
- --help Display help.
- --version Display version information.
Example
Use the command "slocate" to display the paths of files whose names contain the keyword "fdisk"; enter the following command:
$ slocate fdisk #显示文件名中含有fdisk关键字的文件的路径信息
After executing the above command, the output of the command is as follows:
$ slocate fdisk #显示文件名中含有fdisk 关键字的文件的路径信息
/root/cfdisk #搜索到的文件路径列表
/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 Reference