2025-03-14 21:59:59 -06:00
|
|
|
# fd
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
> Find entries in the filesystem.
|
2026-06-12 17:51:25 -06:00
|
|
|
> See also: `find`, `regex`.
|
|
|
|
|
> More information: <https://github.com/sharkdp/fd#command-line-options>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Recursively find files matching a specific pattern in the current directory:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`fd "{{regex}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
- Find files in a specific directory:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`fd "{{regex}}" {{path/to/directory}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Find files with a specific extension:
|
|
|
|
|
|
2025-07-24 22:27:13 -06:00
|
|
|
`fd {{[-e|--extension]}} {{txt}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
- Find only directories matching a specific pattern:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`fd "{{regex}}" {{[-t|--type]}} {{[d|directory]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Include ignored and hidden files in the search:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`fd "{{regex}}" {{[-H|--hidden]}} {{[-I|--no-ignore]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Exclude files that match a specific glob pattern:
|
2025-12-16 10:20:31 -07:00
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`fd "{{regex}}" {{[-E|--exclude]}} {{glob}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
2025-03-14 21:59:59 -06:00
|
|
|
- Execute a command on each search result returned:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`fd "{{regex}}" {{[-x|--exec]}} {{command}}`
|
2026-02-18 06:55:01 -07:00
|
|
|
|
|
|
|
|
- Find files only in the current directory:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`fd "{{regex}}" {{[-d|--max-depth]}} 1`
|