---
tags:
- cli
- l1
- flashcard-deck
- fd
---
<!-- wiki:breadcrumb:start -->
[Portal](../../../../library/portal/index.md) | **Level:** [L1: Foundations](../../../../library/portal/levels.md) | **Topics:** [fd](../../../../library/portal/topics.md) | **Domain:** CLI Tools
<!-- wiki:breadcrumb:end -->

id	category	difficulty	tags	question	answer	source_path
fd/a1e2f3b4c5d6	fd	easy	fd, basics, search	How does fd's default behavior differ from find?	fd searches recursively with a simpler syntax (no need for . or -name), is case-insensitive by default, respects .gitignore, skips hidden files, and uses colorized output.\n\nRemember: fd = "find for humans." Simpler syntax, .gitignore-aware, parallel, colorized, and 3-5x faster.	training/library/topics/fd/primer.md
fd/b2f3a4c5d6e7	fd	easy	fd, types, filter	How do you find only directories (not files) with fd?	Use the -t d flag: fd -t d "config". Similarly, -t f for files only, -t l for symlinks, -t x for executables, and -t e for empty files/dirs.\n\nRemember: -t d=dirs, -t f=files, -t l=symlinks, -t x=executables, -t e=empty. Composable type flags.	training/library/topics/fd/primer.md
fd/c3a4b5d6e7f8	fd	easy	fd, extension, filter	How do you search for files by extension with fd?	Use the -e flag: fd -e yaml finds all YAML files. Combine multiple extensions with: fd -e yaml -e yml.\n\nExample: fd -e py -e js finds Python and JS files. -e handles dotfiles correctly and is more readable than regex.	training/library/topics/fd/primer.md
fd/d4b5c6e7f8a9	fd	medium	fd, hidden, ignore	How do you include hidden files and .gitignore'd files in fd searches?	Use --hidden to include dotfiles, --no-ignore to include .gitignore'd files, or both flags together to include everything.\n\nRemember: --hidden = show dotfiles. --no-ignore = show gitignored. Both = show everything like find.	training/library/topics/fd/primer.md
fd/e5c6d7f8a9b0	fd	medium	fd, exec	What is the difference between --exec and --exec-batch in fd?	--exec runs the command once per match in parallel (like find -exec {} \;). --exec-batch runs the command once with all matches as arguments (like xargs — single process invocation).\n\nRemember: --exec = one cmd per match (parallel). --exec-batch = one cmd with ALL matches (like xargs).	training/library/topics/fd/primer.md
fd/f6d7e8a9b0c1	fd	medium	fd, size, time	How do you filter files by size and modification time with fd?	Use --size for size (e.g., --size +10m for files over 10MB) and --changed-within or --changed-before for time (e.g., --changed-within 24h for recently modified).\n\nExample: fd --size +10m --changed-within 24h finds large recently-modified files. Great for hunting disk hogs.	training/library/topics/fd/primer.md
fd/a7e8f9b0c1d2	fd	medium	fd, exclude	How do you exclude directories or patterns from fd results?	Use the -E flag: fd -E node_modules -E .git "config" excludes those directories. Pattern exclusion: fd -E '*.bak' excludes backup files.\n\nExample: fd -E node_modules -E .git 'config' — clean results. Glob patterns: -E '*.bak' excludes backups.	training/library/topics/fd/primer.md
fd/b8f9a0c1d2e3	fd	hard	fd, exec, placeholders	What placeholder tokens are available in fd's --exec command?	{} = full path, {/} = basename, {//} = parent directory, {.} = path without extension, {/.} = basename without extension.\n\nRemember: {} full path, {/} basename, {//} parent, {.} no extension, {/.} basename no extension.	training/library/topics/fd/primer.md
fd/c9a0b1d2e3f4	fd	hard	fd, glob, regex	How do you switch fd from regex mode to glob mode?	Use the -g flag: fd -g '*.yaml' uses glob matching. Use -F for fixed string matching (no regex). Default mode is regex: fd '^test.*\.py$'.\n\nRemember: default=regex, -g=glob, -F=fixed string. Three search modes for different needs.	training/library/topics/fd/primer.md
fd/d0b1c2e3f4a5	fd	hard	fd, config, ignore	How do you configure project-level ignore rules for fd?	Create a .fdignore file in the project root with .gitignore syntax. fd also reads .ignore files (shared with rg). Global ignores go in ~/.fdignore.\n\nAnalogy: .fdignore is to fd what .gitignore is to git — same glob syntax, same purpose (skip unwanted paths).\n\nGotcha: fd reads .gitignore AND .fdignore AND .ignore. Use --no-ignore to override all three.\n\nWho made it: David Peter (sharkdp) created fd in 2017 as a Rust rewrite of find.	training/library/topics/fd/primer.md
fd/e1c2d3f4a5b6	fd	easy	fd, case, search	How do you force a case-insensitive search with fd when the pattern contains uppercase letters?	Use the -i flag: fd -i "README". By default fd is smart-case (case-insensitive unless pattern has uppercase). The -i flag forces case-insensitive regardless.\n\nUnder the hood: smart-case — lowercase=insensitive, any uppercase=sensitive. Same as ripgrep. -i forces insensitive.	
fd/f2d3e4a5b6c7	fd	medium	fd, depth, limit	How do you limit how deep fd searches into directory trees?	Use --max-depth (or -d): fd -d 2 "config" searches only the current directory and one level of subdirectories. Useful for avoiding deep node_modules or vendor trees.\n\nExample: fd -d 1 lists only immediate children — equivalent to ls but with regex.\n\nGotcha: --max-depth 0 means current directory only (files in .), which is rarely useful.	
fd/a3e4f5b6c7d8	fd	medium	fd, null, xargs	How do you safely pipe fd results containing spaces or special characters to xargs?	Use fd's -0 flag with xargs -0: fd -0 -e log | xargs -0 rm. The -0 flag outputs null-separated paths instead of newline-separated, preventing word-splitting issues.\n\nRemember: Null-separated output prevents word-splitting on filenames with spaces, newlines, or quotes.\n\nAnalogy: -0 is the universal safe-pipe flag. ripgrep, fd, xargs, sort, and find all support it.	
fd/b4f5a6c7d8e9	fd	medium	fd, exec, placeholder	How do you use fd --exec to convert every found .jpg file to .png using a command?	fd -e jpg --exec convert {} {.}.png. The {} placeholder is the full path and {.} is the path without extension, so each file.jpg becomes file.png.\n\nUnder the hood: {.} strips extension (file.jpg → file), so {.}.png → file.png. No shell manipulation needed.	
fd/c5a6b7d8e9f0	fd	easy	fd, color, output	How do you control color output in fd?	Use --color with never, auto, or always: fd --color never "pattern" disables color (useful when piping to other tools). Default is auto (color for terminals, plain for pipes).\n\nGotcha: auto mode disables color when piping. Use --color always for pipes (e.g., less -R).	
fd/d6b7c8e9f0a1	fd	hard	fd, performance, parallel	How does fd achieve faster searches than find on large directory trees?	fd uses multi-threaded directory traversal by default, parallelizing filesystem stat calls. It also skips .gitignore'd paths and hidden directories, reducing total work. Use --threads N to control parallelism.\n\nUnder the hood: multi-threaded traversal (--threads N) + .gitignore skipping = 3-5x faster than single-threaded find.	
fd/f92bfa838c0b	fd	medium	fd;patterns	How does fd handle .gitignore patterns by default?	fd respects .gitignore patterns automatically — files ignored by git are excluded from results unless you use --no-ignore or --hidden flags.\n\nGotcha: fd respects .gitignore even outside git repos. Use --no-ignore to override.	
fd/efb321fee7f3	fd	medium	fd;exec	How do you execute a command on each fd result?	Use fd PATTERN --exec COMMAND {} where {} is replaced by each match. For batch execution, use --exec-batch to run the command once with all matches as arguments.\n\nExample: fd -e log --exec gzip {} compresses every log file in parallel. Faster than find -exec on multi-core.	
fd/d26eeba5282d	fd	hard	fd;performance	Why is fd faster than find for most interactive searches?	fd uses parallel directory traversal, respects gitignore (skips large dirs like node_modules), and defaults to regex rather than glob — reducing the search space and leveraging multiple cores.\n\nUnder the hood: multi-threaded traversal (--threads N) + .gitignore skipping = 3-5x faster than single-threaded find.	
fd/597471943d91	fd	medium	fd;extensions	How do you search for files by extension using fd?	Use fd -e EXT (e.g., fd -e py). Multiple extensions: fd -e py -e js. This filters by extension after the pattern match.\n\nExample: fd -e py -e js finds Python and JS files. -e handles dotfiles correctly and is more readable than regex.	

<!-- wiki:related:start -->
---

## Wiki Navigation

### Related Content

- [Modern CLI Tools](../../../../library/topics/modern-cli/index.md) (Topic Pack, L0) — fd
- [Skillcheck: Modern CLI Tools](../../../../library/skillchecks/modern-cli-tools.skillcheck.md) (Assessment, L0) — fd
- [fd](../../../../library/topics/fd/index.md) (Topic Pack, L1) — fd

<!-- wiki:related:end -->
