Add documentation and examples of ** in glob mode

And how it should be used with the `--full-path` option.

Fixes #764.
This commit is contained in:
Thayne McCombs 2021-08-10 00:42:53 -06:00 committed by David Peter
parent 500f404c4f
commit 1795e0e9dd
2 changed files with 10 additions and 0 deletions

View File

@ -145,6 +145,15 @@ target/debug/deps/libnum_cpus-f5ce7ef99006aa05.rlib
To really search *all* files and directories, simply combine the hidden and ignore features to show
everything (`-HI`).
### Matching the full path
By default, *fd* only matches the filename of each file. However, using the `--full-path` or `-p` option,
you can match against the full path.
```bash
> fd -p -g '**/.git/config'
> fd -p '.*/lesson-\d+/[a-z]+.(jpg|png)'
```
### Command execution
Instead of just showing the search results, you often want to *do something* with them. `fd`

1
doc/fd.1 vendored
View File

@ -55,6 +55,7 @@ pattern contains an uppercase character (smart case).
.TP
.B \-g, \-\-glob
Perform a glob-based search instead of a regular expression search.
If combined with the '\-\-full-path' option, '**' can be used to match multiple path components.
.TP
.B \-\-regex
Perform a regular-expression based search (default). This can be used to override --glob.