Why Can't I Find My File?
The most common point of confusion for new fd users is executing a search for a file they know exists, only for fd to return nothing.
Because fd is highly opinionated about what it ignores, false negatives are a frequent occurrence until you understand its rules.
Scenario 1: The File is Hidden
If the file you are looking for starts with a dot (e.g., .env, .htaccess), or resides inside a hidden directory (e.g., .config/app/settings.json), fd will not see it.
The Fix:
Use the -H (--hidden) flag.
fd -H ".env"
Scenario 2: The File is Git-Ignored
If you are searching for an installed package file (e.g., inside node_modules or vendor), or a compiled build artifact, fd will read the project's .gitignore file and skip the entire directory.
The Fix:
Use the -I (--no-ignore) flag to disable .gitignore parsing.
fd -I "lodash.js"
Scenario 3: The Ultimate Override
If you are unsure whether the file is hidden, ignored, or both, and you just want fd to behave like a brute-force find command, use the double-unrestricted flag (-uu).
The Fix:
Use -uu (which is an alias for -H -I).
fd -uu "missing_file.txt"
Scenario 4: Regex Special Characters
Because fd treats patterns as regular expressions by default, searching for strings containing dots, brackets, or plus signs can fail if they are interpreted as regex operators.
If you search for app+main.js, the + means "one or more of the previous character".
The Fix:
Use the -g (--glob) or -F (--fixed-strings) flag.
# Literal string search
fd -F "app+main.js"
Scenario 5: Absolute Paths vs Relative Paths
If you are piping fd output to another command, and that command fails saying "File not found", it is likely because fd returned a relative path (./dir/file.txt), but your script executed from a different working directory.
The Fix:
Force fd to output absolute paths using the -a flag.
fd pattern -a