Skip to content
Myr

Documentation for `-E` and `.fdignore`, see #156

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by GitHub · parent c654159 · Browse files · 1 file+28 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+28 added−0 removed

  • other:+28 added−0 removed

1 file+28 added−0 removed

modified:README.md+28 added
331 unmodified lines
332333To really search *all* files and directories, simply combine the hidden and ignore features to show334everything (`-HI`).335336### Excluding specific files or directories337338Sometimes we want to ignore search results from a specific subdirectory. For example, we might339want to search all hidden files and directories (`-H`) but exclude all matches from `.git`340directories. We can use the `-E` (or `--exclude`) option for this. It takes an arbitrary glob341pattern as an argument:342``` bash343> fd -H -E .git …344```345346We can also use this to skip mounted directories:347``` bash348> fd -E /mnt/external-drive …349```350351.. or to skip certain file types:352``` bash353> fd -E '*.bak' …354```355356To make exclude-patterns like these permanent, you can create a `.fdignore` file. They work like357`.gitignore` files, but are specific to `fd`. For example:358``` bash359> cat ~/.fdignore360/mnt/external-drive361*.bak362```363364### Using fd with `xargs` or `parallel`365366If we want to run a command on all search results, we can pipe the output to `xargs`:367``` bash
27 unmodified lines