Move command execution section
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Peter · committed by David Peter · parent 5423c45 · Browse files · 1 file·+33 added−33 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+33 added−33 removed
- other:+33 added−33 removed
Provenance
- Commit
d283aba- Tree
dd5f65f- Author
David Peter <mail@david-peter.de>- Committer
David Peter <mail@david-peter.de>- Parent
5423c45
1 file changed+33 added−33 removed
modified:README.md+33 added-33 removed
135 unmodified lines136 137 To really search *all* files and directories, simply combine the hidden and ignore features to show138 everything (`-HI`).139 140-### Excluding specific files or directories141-142-Sometimes we want to ignore search results from a specific subdirectory. For example, we might143-want to search all hidden files and directories (`-H`) but exclude all matches from `.git`144-directories. We can use the `-E` (or `--exclude`) option for this. It takes an arbitrary glob145-pattern as an argument:146-``` bash147-> fd -H -E .git …148-```149-150-We can also use this to skip mounted directories:151-``` bash152-> fd -E /mnt/external-drive …153-```154-155-.. or to skip certain file types:156-``` bash157-> fd -E '*.bak' …158-```159-160-To make exclude-patterns like these permanent, you can create a `.fdignore` file. They work like161-`.gitignore` files, but are specific to `fd`. For example:162-``` bash163-> cat ~/.fdignore164-/mnt/external-drive165-*.bak166-```167-Note: `fd` also supports `.ignore` files that are used by other programs such as `rg` or `ag`.168-169-If you want `fd` to ignore these patterns globally, you can put them in `fd`'s global ignore file.170-This is usually located in `~/.config/fd/ignore` in macOS or Linux, and `%APPDATA%\fd\ignore` in171-Windows.172-140 ### Command execution141 142 Instead of just showing the search results, you often want to *do something* with them. `fd`143 provides two ways to execute external commands for each of your search results:56 unmodified lines200 201 For `-x`/`--exec`, you can control the number of parallel jobs by using the `-j`/`--threads` option.202 Use `--threads=1` for serial execution.203 204+### Excluding specific files or directories205+206+Sometimes we want to ignore search results from a specific subdirectory. For example, we might207+want to search all hidden files and directories (`-H`) but exclude all matches from `.git`208+directories. We can use the `-E` (or `--exclude`) option for this. It takes an arbitrary glob209+pattern as an argument:210+``` bash211+> fd -H -E .git …212+```213+214+We can also use this to skip mounted directories:215+``` bash216+> fd -E /mnt/external-drive …217+```218+219+.. or to skip certain file types:220+``` bash221+> fd -E '*.bak' …222+```223+224+To make exclude-patterns like these permanent, you can create a `.fdignore` file. They work like225+`.gitignore` files, but are specific to `fd`. For example:226+``` bash227+> cat ~/.fdignore228+/mnt/external-drive229+*.bak230+```231+Note: `fd` also supports `.ignore` files that are used by other programs such as `rg` or `ag`.232+233+If you want `fd` to ignore these patterns globally, you can put them in `fd`'s global ignore file.234+This is usually located in `~/.config/fd/ignore` in macOS or Linux, and `%APPDATA%\fd\ignore` in235+Windows.236+237 ### Deleting files238 239 You can use `fd` to remove all files and directories that are matched by your search pattern.240 If you only want to remove files, you can use the `--exec-batch`/`-X` option to call `rm`. For397 unmodified lines