You don’t have to remember find . -name "*.log" -type f -not -path "*/node_modules/*". In most cases fd log covers it.

Install

  brew install fd
sudo apt install fd-find        # the binary is called fdfind
winget install sharkdp.fd
  

On Ubuntu, alias it:

  alias fd=fdfind
  

Basics

  fd config                # anything with "config" in the name
fd -e md                 # files with the .md extension
fd -e md -e mdx docs/    # several extensions, in one directory
fd -H secret             # include hidden files
fd -t d node_modules     # directories only
  

Options worth knowing

OptionMeaning
-e <ext>Filter by extension
-t f / -t d / -t lFiles / directories / symlinks
-HInclude hidden files
-IIgnore .gitignore
-d 2Limit search depth
-sCase sensitive
--changed-within 1dModified in the last day
-x <cmd>Run a command per result
-X <cmd>Pass all results to one command

Acting on what you find

  # convert every png to webp
fd -e png -x cwebp {} -o {.}.webp

# delete logs older than 30 days (list them first!)
fd -e log --changed-before 30d
fd -e log --changed-before 30d -X rm

# locate every package.json
fd -H '^package\.json$' -t f
  

{} is the path, {.} is the path without its extension, and {/} is the basename.

Compared to find

Goalfindfd
By namefind . -name "*conf*"fd conf
By extensionfind . -name "*.md"fd -e md
Directories onlyfind . -type d -name distfd -t d dist
Recently modifiedfind . -mtime -1fd --changed-within 1d

Because it honours .gitignore by default, results inside a project stay clean. When you do need the build output, add -I.

Next

Now that you can find files, make them pleasant to read → bat

Last updated 19 Aug 2026, 00:00 UTC. history