You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.2 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

slocate
===
命令查找文件或目录
## 补充说明
**slocate命令** 是一个命令查找文件或目录。slocate本身具有一个数据库里面存放了系统中文件与目录的相关信息。
### 语法
```
slocate [-u][--help][--version][-d <目录>][查找的文件]
```
### 选项
```
-d<目录>或--database=<目录>  指定数据库所在的目录。
-u  更新slocate数据库。
--help  显示帮助。
--version  显示版本信息。
```
### 实例
使用指令"slocate"显示文件名中含有关键字"fdisk"的文件路径信息,输入如下命令:
```
$ slocate fdisk #显示文件名中含有fdisk关键字的文件的路径信息
```
执行以上命令后,指令执行的输出信息如下:
```
$ 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命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->