From 4126365b33415fa660b218873f9a99dc0af9248c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=BC=9F=E8=B0=83=E8=B0=83=E2=84=A2?= Date: Fri, 8 Apr 2022 17:43:03 +0800 Subject: [PATCH] Update locate.md --- command/locate.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/command/locate.md b/command/locate.md index be8726ec3a..fd1cdc36ac 100644 --- a/command/locate.md +++ b/command/locate.md @@ -16,7 +16,11 @@ locate指令和find找寻档案的功能类似,但locate是透过update程序 ### 语法 ```shell -locate [选择参数] [样式] +locate [-d path | --database=path] [-e | -E | --[non-]existing] [-i | + --ignore-case] [-0 | --null] [-c | --count] [-w | --wholename] [-b | + --basename] [-l N | --limit=N] [-S | --statistics] [-r | --regex ] + [--regextype R] [--max-database-age D] [-P | -H | --nofollow] [-L | + --follow] [--version] [-A | --all] [-p | --print] [--help] pattern... ``` ### 选项 @@ -46,7 +50,7 @@ locate [选择参数] [样式] ### 实例 -实例1:查找和pwd相关的所有文件 +实例1:查找和 `pwd` 相关的所有文件 ```shell root ~ # locate pwd @@ -67,7 +71,7 @@ root ~ # locate pwd /usr/share/help/el/empathy/irc-join-pwd.page ``` -实例2: 搜索etc目录下所有以sh开头的文件 +实例2: 搜索 etc 目录下所有以 sh 开头的文件 ```shell root ~ # locate /etc/sh @@ -88,4 +92,9 @@ root ~ # locate /etc/m /etc/mate-settings-daemon ``` +忽略大小写搜索当前用户目录下所有以 `r` 开头的文件 : + +```shell +locate -i ~/r +```