sharkdp /fd

A simple, fast and user-friendly alternative to 'find'

★ 45,131⑂ 1,303👁 163⑃ 1,103● 1,013▤ 47◈ 71
RustApache-2.0Created 2017-05-09
TA的项目
45,131
stars
+2+203+485
1,303
forks
163
watchers
1,103
prs
1,013
issues
47
releases
71
discussions

README

fd



[中文]
[한국어]

fd is a program to find entries in your filesystem.
It is a simple, fast and user-friendly alternative to find.
While it does not aim to support all of find's powerful functionality, it provides sensible
(opinionated) defaults for a majority of use cases.

Installation • How to use • Troubleshooting

 Features

 Intuitive syntax: fd PATTERN instead of find -iname 'PATTERN'.
 Regular expression (default) and glob-based patterns.
 Very fast due to parallelized directory traversal.
 Uses colors to highlight different file types (same as ls).
 Supports parallel command execution
 Smart case: the search is case-insensitive by default. It switches to
  case-sensitive if the pattern contains an uppercase
  character\.
 Ignores hidden directories and files, by default.
 Ignores patterns from your .gitignore, by default.
 The command name is 50% shorter\ than
  find :-).

 Demo

!Demo

 How to use

First, to get an overview of all available command line options, you can either run
fd -h for a concise help message or fd --help for a more detailed
version.

 Simple search

fd is designed to find entries in your filesystem. The most basic search you can perform is to
run fd with a single argument: the search pattern. For example, assume that you want to find an
old script of yours (the name included netflix):
 bash
 fd netfl
Software/python/imdb-ratings/netflix-details.py

If called with just a single argument like this, fd searches the current directory recursively
for any entries that contain the pattern netfl.

 Regular expression search

The search pattern is treated as a regular expression. Here, we search for entries that start
with x and end with rc:
 bash
 cd /etc
 fd '^x.rc$'
X11/xinit/xinitrc
X11/xinit/xserverrc


The regular expression syntax used by fd is documented here.

 Specifying the root directory

If we want to search a specific directory, it can be given as a second argument to fd:
 bash
 fd passwd /etc
/etc/default/passwd
/etc/pam.d/passwd
/etc/passwd


 List all files, recursively

fd can be called with no arguments. This is very useful to get a quick overview of all entries
in the current directory, recursively (similar to ls -R):
 bash
 cd fd/tests
 fd
testenv
testenv/mod.rs
tests.rs


If you want to use this functionality to list all files in a given directory, you have to use
a catch-all pattern such as . or ^:
 bash
 fd . fd/tests/
testenv
testenv/mod.rs
tests.rs


 Searching for a particular file extension

Often, we are interested in all files of a particular type. This can be done with the -e (or
--extension) option. Here, we search for all Markdown files in the fd repository:
 bash
 cd fd
 fd -e md
CONTRIBUTING.md
README.md


The -e option can be used in combination with a search pattern:
 bash
 fd -e rs mod
src/fshelper/mod.rs
src/lscolors/mod.rs
tests/testenv/mod.rs


 Searching for a particular file name

 To find files with exactly the provided search pattern, use the -g (or --glob) option:
 bash
 fd -g li

Top issues

Discussions

Latest release

v10.5.2 v10.5.2 2026-11-07
Bugfixes
- Fix invalid syntax in zsh completions. See 2216
- Write raw bytes instead of replacing them with U+FFFD when --format output goes to a pipe, so filenames that are not valid UTF-8 reach downstream tools unchanged; see 2189.

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON