2021-03-08 20:22:42 +00:00
|
|
|
|
# locate
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
> 快速查找文件名。
|
2024-01-31 10:20:27 +00:00
|
|
|
|
> 更多信息:<https://keith.github.io/xcode-man-pages/locate.1.html>.
|
2021-03-08 20:22:42 +00:00
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 在数据库中查找关键字。注意:数据库定期重新更新(通常每周或每天):
|
2021-03-08 20:22:42 +00:00
|
|
|
|
|
2024-01-01 09:38:53 +00:00
|
|
|
|
`locate "{{关键字}}"`
|
2021-03-08 20:22:42 +00:00
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 按文件名查找文件(不包含填充字符的模式被解释为 `*关键字*`):
|
2021-03-08 20:22:42 +00:00
|
|
|
|
|
|
|
|
|
`locate */{{文件名}}`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 重新建立文件数据索引数据库。如果要查找最近添加的文件,则需要执行此操作:
|
2021-03-08 20:22:42 +00:00
|
|
|
|
|
|
|
|
|
`sudo /usr/libexec/locate.updatedb`
|