Skip to content

Commit 55b78db

Browse files
committed
Ch03: Add fd
1 parent f3e2dcf commit 55b78db

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

docs/Ch03/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,20 @@ $ find [OPTION] PATH [EXPRESSION]
822822
md5sum file1 file2 file3 ...
823823
```
824824

825+
!!! tip "fd"
826+
827+
[fd](https://github.com/sharkdp/fd) 是 find 的更现代、好用的替代。在 Ubuntu 下需要安装 `fd-find` 包,并且命令名为 **`fdfind`**(而非 `fd`)。
828+
829+
其默认接受正则表达式(见[第九章](../Ch09/index.md))作为搜索条件,例如搜索结尾为 `.conf` 的文件:
830+
831+
```console
832+
$ fdfind '\.conf$' /etc/
833+
/etc/debconf.conf
834+
/etc/gai.conf
835+
/etc/host.conf
836+
(以下省略)
837+
```
838+
825839
### 模式匹配 {#pattern}
826840

827841
许多现代的 shell 都支持一定程度的模式匹配。举个例子,bash 的匹配模式被称为 [glob](https://mywiki.wooledge.org/glob),支持的操作如下:

0 commit comments

Comments
 (0)