LIVEReading: Find Files Fast: Replace 'find' with fd in 5 MinutesTotal time: 6 minSteps: 6Worked first time: 92% LIVEReading: Find Files Fast: Replace 'find' with fd in 5 MinutesTotal time: 6 minSteps: 6Worked first time: 92%
CBW
Find Files Fast: Replace 'find' with fd in 5 Minutes
Easygithub.com/sharkdp/fd2026-06-17

Find Files Fast: Replace 'find' with fd in 5 Minutes

fd is a simpler, faster alternative to the Unix 'find' command. Type less, get results instantly, with color-coded output.

// Build stats

  • Total time6 min
  • Number of steps6
  • DifficultyEasy
  • Worked first time92%
// Before you start

What you need

  • A Mac, Linux, or Windows computer
  • Terminal / Command Prompt access
  • Admin or sudo rights to install software
01
Step 1 of 6

Install fd on your system

2 min

fd is a pre-built program — no compiling needed. Pick the one command that matches your operating system and paste it in your terminal. On Mac you use Homebrew. On Ubuntu/Debian Linux you use apt. On Windows you use winget (built into Windows 10/11).

Terminal · mac
$ # macOS:
$ brew install fd
$
$ # Ubuntu / Debian Linux:
$ sudo apt install fd-find
$
$ # Windows (PowerShell):
$ winget install sharkdp.fd
What you should see
The package manager downloads and installs fd. You'll see a line like 'Successfully installed' or similar. No errors in red.
This might happen

On Ubuntu/Debian the installed command is called 'fdfind', not 'fd', to avoid a name conflict with another package.

Run 'fdfind' instead of 'fd', or create a shortcut by running: mkdir -p ~/.local/bin && ln -s $(which fdfind) ~/.local/bin/fd — then open a new terminal window.

02
Step 2 of 6

Confirm fd is working

1 min

Before doing anything else, verify the install succeeded. This command prints the version number. If you see a version, you're good to go.

Terminal · mac
$ fd --version
What you should see
fd 10.x.x (or similar version number)
This might happen

'command not found' error after install

Close your terminal completely and open a new one. The system needs to reload its list of available programs.

03
Step 3 of 6

Search for a file by name

2 min

The most common thing you'll do: find a file when you only remember part of its name. Just type 'fd' followed by any part of the filename. fd searches the current folder and all folders inside it. It's case-insensitive by default, so 'readme' finds 'README.md' too.

Terminal · mac
$ fd readme
What you should see
A list of file paths containing 'readme' in their name, color-coded by file type. If nothing is found, you get a blank line (no error).
This might happen

No results even though you know the file exists

fd skips hidden files and folders (those starting with a dot) by default. Add -H to include them: fd -H readme

04
Step 4 of 6

Search by file extension

2 min

Need all PDF files, or all images? Use the -e flag followed by the extension (no dot needed). You can combine it with a name pattern or leave the pattern blank to match everything with that extension.

Terminal · mac
$ # Find all PDF files in current folder and subfolders:
$ fd -e pdf
$
$ # Find all PNG images:
$ fd -e png
$
$ # Find PDF files with 'invoice' in the name:
$ fd -e pdf invoice
What you should see
A list of matching file paths. For example: Documents/invoice_2024.pdf
05
Step 5 of 6

Search inside a specific folder

1 min

By default fd searches wherever your terminal is currently sitting. To search a different folder, add its path as a second argument after your search term. You can use full paths or relative ones.

Terminal · mac
$ # Search for 'config' files inside /etc:
$ fd config /etc
$
$ # Search for text files in your Downloads folder:
$ fd -e txt ~/Downloads
What you should see
A list of matching files found inside the folder you specified.
This might happen

Permission denied errors on Linux/Mac when searching system folders like /etc

Prepend 'sudo' to the command: sudo fd config /etc

06
Step 6 of 6

Do something with every file found

3 min

fd can run a command on every file it finds using the -x flag. The placeholder {} stands for each found file. This is useful for bulk operations like opening files, moving them, or checking their details. The -X flag (capital X) runs the command once with all results at once instead of one at a time.

Terminal · mac
$ # Show detailed info (size, date, permissions) for every PDF found:
$ fd -e pdf -X ls -lh
$
$ # Open all found text files in a text editor (Mac example):
$ fd -e txt -X open
$
$ # Print the full path of every jpg found:
$ fd -e jpg -x echo {}
What you should see
The output of whatever command you ran, applied to each matching file. For 'ls -lh' you'll see a detailed file listing.
This might happen

Using -x with a destructive command (like rm or mv) by accident on more files than intended

Always run fd without -x first to preview exactly which files will be affected. Only add -x once you're sure the list is correct.

// Status

cooked. baked. worked.

A working 'fd' command in your terminal that finds files by name or extension faster and more intuitively than the built-in 'find' command, with color-coded results.

// the honest bit

The honest part

fd is a search tool only — it finds files, it doesn't manage or edit them. It intentionally skips hidden files and .gitignore-listed files by default, which surprises people. It doesn't replicate every obscure option that the Unix 'find' command has, so power users doing complex scripted searches may still need 'find' occasionally. On Ubuntu/Debian the name conflict with another package means you may need the 'fdfind' alias workaround.