---
title: "TIL: Finding Files Fast With fd"
description: fd is a gitignore-aware, colourful replacement for find. One command locates files by name, type, or extension, and it runs fast out of the box.
canonical: https://lukeocodes.dev/til-finding-files-fast-with-fd
type: article
locale: en_GB
published: 2026-08-25T00:00:00.000Z
modified: 2026-08-25T00:00:00.000Z
authors:
  - Luke Oliff
section: TIL
tags:
  - TIL
  - Developer Experience
  - Open Source
feed: https://lukeocodes.dev/rss.xml
search: https://lukeocodes.dev/search.json?q={query}
schema:
  - "@context": https://schema.org
    "@graph":
      - "@type": WebSite
        "@id": https://lukeocodes.dev/#website
        url: https://lukeocodes.dev
        name: Luke Oliff
        alternateName: lukeocodes
        inLanguage: en
        publisher:
          "@id": https://lukeocodes.dev/authors/luke#person
        description: Personal blog and writing by Luke Oliff — developer relations, voice AI, developer experience.
        potentialAction:
          - "@type": SearchAction
            target:
              "@type": EntryPoint
              urlTemplate: https://lukeocodes.dev/blog/search?q={search_term_string}
            query-input: required name=search_term_string
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Engineer and developer relations leader. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Engineer and developer relations leader
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
  - "@context": https://schema.org
    "@graph":
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Engineer and developer relations leader. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Engineer and developer relations leader
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
      - "@type": BlogPosting
        "@id": https://lukeocodes.dev/til-finding-files-fast-with-fd#article
        headline: "TIL: Finding Files Fast With fd"
        alternativeHeadline: "TIL: Finding Files Fast With fd"
        description: fd is a gitignore-aware, colourful replacement for find. One command locates files by name, type, or extension, and it runs fast out of the box.
        datePublished: 2026-08-25T00:00:00.000Z
        dateModified: 2026-08-25T00:00:00.000Z
        url: https://lukeocodes.dev/til-finding-files-fast-with-fd
        mainEntityOfPage: https://lukeocodes.dev/til-finding-files-fast-with-fd
        inLanguage: en
        author:
          - "@id": https://lukeocodes.dev/authors/luke#person
        isPartOf:
          "@id": https://lukeocodes.dev/#website
        keywords: TIL, Developer Experience, Open Source
        articleSection: TIL
        about:
          - "@type": Thing
            name: Developer Experience
          - "@type": Thing
            name: Open Source
        abstract: "fd is the find replacement to reach for: gitignore-aware, colourful, and one command finds files by name, type, or extension, with an exec mode that runs a command per match."
        speakable:
          "@type": SpeakableSpecification
          cssSelector:
            - .post-tldr
            - h1
        image: https://lukeocodes.dev/blog/til-finding-files-fast-with-fd/hero.png
        wordCount: 376
        timeRequired: PT2M
        publisher:
          "@id": https://lukeocodes.dev/authors/luke#person
      - "@type": BreadcrumbList
        itemListElement:
          - "@type": ListItem
            position: 1
            name: Home
            item: https://lukeocodes.dev
          - "@type": ListItem
            position: 2
            name: Writing
            item: https://lukeocodes.dev/blog
          - "@type": ListItem
            position: 3
            name: "TIL: Finding Files Fast With fd"
            item: https://lukeocodes.dev/til-finding-files-fast-with-fd
---

[Luke Oliff.](/)

- [Blog](/blog)
- [CV](/cv)
- [Uses](/uses)
- [User manual](/user-manual)
- [Living with ADHD](/living-and-working-with-adhd)
- [RSS](/rss.xml)

[Luke Oliff · Writing](/blog)

# TIL: Finding Files Fast With fd

Aug 2026 · [TIL](/blog/category/til) · 2 min read · [Luke Oliff](/authors/luke)

**TL;DR:** fd is the find replacement to reach for: gitignore-aware, colourful, and one command finds files by name, type, or extension, with an exec mode that runs a command per match.

I still type `find` out of habit, but [fd](https://github.com/sharkdp/fd) is the tool I actually want. Where `find . -name '*config*'` is noisy and ignores nothing, `fd` is fast, colourised, and respects your `.gitignore` by default. If you have ever wrestled with `find -exec` ([I wrote about that trick too](https://lukeocodes.dev/til-find-exec-batch-operations)), `fd` makes the common cases almost boring.

### The technique: find files by name

```bash
fd config
```

That single command searches the current directory recursively, skips ignored files, and highlights matches. No path argument, no `-name`, no quoting gymnastics. `fd` treats the pattern as a regular expression, so `fd '^config\.'` anchors the match to the start of a filename.

### The trick: filter by type and run a command per match

The real leverage is `fd`'s filters plus its exec mode. Restrict by extension and file type, then run a command against every match with `-x`:

```bash
# Count lines across every TypeScript file
fd -e ts -x wc -l

# Run prettier over every file fd finds
fd -e ts -x prettier --write
```

`-e ts` limits results to `.ts` files, `-t f` keeps files only (use `-t d` for directories), and `-x` runs the command once per result, appending the path automatically. It is the same idea as `find -exec` but without the semicolons and `{}` boilerplate. You can also just pipe: `fd -e md | wc -l` counts your markdown files in a blink.

### FAQ

#### How is fd different from find?

`fd` defaults to recursive search from the current directory, respects `.gitignore`, and colourises output, while `find` ignores nothing and prints plain text. `fd` also takes a regex pattern instead of a glob, so simple name searches need less typing.

#### Can I run other commands against the results?

Yes. Use `-x` to execute a command per match (like the `wc -l` and `prettier` examples above), or pipe `fd`'s output into `xargs` for batch work — the same pattern I covered in [the find -exec post](https://lukeocodes.dev/til-find-exec-batch-operations).

#### How do I install fd?

It ships as a single static binary. On macOS run `brew install fd`; on Linux use your package manager (`apt install fd-find`, where the binary is `fdfind`) or `cargo install fd-find`; on Windows it is on Scoop and Chocolatey.

[← Newer: The Critical Next.js Security Patch You Shouldn't Skip](/nextjs-security-patch)

[All posts](/blog) →

## Search this site

`GET https://lukeocodes.dev/search.json?q=<words>` returns matching posts as JSON, each with its page URL and its markdown URL. Add `&limit=<1-50>` for more than 10. How it works: [/blog/search](https://lukeocodes.dev/blog/search.md).

```sh
curl "https://lukeocodes.dev/search.json?q=developer+relations"
```

---

© 2026 Luke Oliff. Posts live at the root of this site.

- [GitHub](https://github.com/lukeocodes)
- [LinkedIn](https://www.linkedin.com/in/lukeocodes)
- [X](https://x.com/lukeocodes)
- [Bluesky](https://bsky.app/profile/lukeocodes.dev)
- [Email](mailto:luke@lukeoliff.com)
- [RSS](/rss.xml)

## Cookies

This site sets one analytics cookie, from Google Analytics, and only in a browser that accepts the cookie banner. A client that does not run scripts sets no cookies, so there is nothing to accept or decline here.

[Cookie policy](/cookies)
