blog6 min read

Best File Search and Navigation CLI Tools

Finding files, searching code, and navigating directories are the operations you run most often in a terminal. The built-in tools (find, grep, cd) work, but modern alternatives are faster, smarter, and more ergonomic.

Here are the file search and navigation tools worth knowing. Every tool links to its clihub listing.


Fuzzy Finding

fzf — The Universal Fuzzy Finder

fzf is a general-purpose fuzzy finder that turns any list into an interactive, searchable menu. Pipe in file names, git branches, command history, process IDs — anything with lines of text.

How to use fzf — common patterns:

# Fuzzy find files
fzf

# Search and open in editor
vim $(fzf)

# Git branch checkout
git branch | fzf | xargs git checkout

# Kill a process
ps aux | fzf | awk '{print $2}' | xargs kill

# Search command history
history | fzf

Shell integration is where fzf gets powerful. Add it to your shell config:

# Fish
fzf --fish | source

# Zsh (add to .zshrc)
source <(fzf --zsh)

# Bash (add to .bashrc)
eval "$(fzf --bash)"

This gives you:

  • Ctrl+T — fuzzy find files and insert the path
  • Ctrl+R — fuzzy search command history
  • Alt+C — fuzzy find and cd into a directory

Pair with fd: By default, fzf uses find to list files. Set it to use fd instead for speed and .gitignore support:

export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow'
brew install fzf

File Finding

fd — Modern find

A faster, simpler alternative to find. Regex by default, ignores .gitignore and hidden files automatically, colorized output.

Examples:

# Find files by extension
fd "\.rs$"

# Find files by name
fd config

# Find and delete
fd "\.tmp$" --exec rm {}

# Find only directories
fd --type d src

# Include hidden files
fd --hidden ".env"

The biggest difference from find: you don't need to remember flag syntax. fd pattern just works.

brew install fd

Searches file contents, not file names. Ripgrep is the standard for searching through codebases — it respects .gitignore, skips binaries, and is significantly faster than grep -r.

Examples:

# Search for a string
rg "TODO"

# Search specific file types
rg "import" --type py

# Show context around matches
rg "error" -C 3

# Count matches per file
rg "TODO" --count

# Case-insensitive search
rg -i "readme"
brew install ripgrep

For a deeper comparison of ripgrep vs grep and other modern replacements, see Modern Alternatives to Classic Unix Commands.


Directory Navigation

zoxide — Smart cd

Tracks your most-visited directories and lets you jump to them with partial names. After a few days of use, you stop typing full paths.

Examples:

# Jump to a directory you've visited before
z proj          # → ~/code/my-project
z doc           # → ~/Documents
z api test      # → ~/code/my-api/tests

# See ranked directories
zoxide query --list

# Interactive selection (with fzf)
zi

Initialize in your shell config:

# Fish
zoxide init fish | source

# Zsh
eval "$(zoxide init zsh)"
brew install zoxide

Terminal File Managers

When you need to browse files visually without leaving the terminal.

yazi — Fast File Manager

A modern terminal file manager written in Rust. File previews (text, images, PDFs), tabbed browsing, bulk operations, and a plugin system. The fastest option for terminal-based file browsing.

brew install yazi

ranger — Classic File Manager

The original terminal file manager with vi-style keybindings. Three-column layout (parent, current, preview), file previews, bookmarks, and tabs. Written in Python, highly customizable.

brew install ranger

nnn — Minimal File Manager

The lightest terminal file manager. Written in C, starts instantly, minimal dependencies. Supports plugins for extended functionality. Choose nnn if you want speed and simplicity over features.

brew install nnn

A new way to browse directories. Shows a tree view that you can fuzzy-search in real time. Type to filter, arrow keys to navigate, enter to cd into a directory. Combines the benefits of tree, find, and cd in one tool.

brew install broot

Comparison Table

ToolWhat it doesReplacesLanguage
fzfFuzzy finder for any listManual searchingGo
fdFind files by namefindRust
ripgrepSearch file contentsgrep -rRust
zoxideSmart directory jumpingcdRust
yaziTerminal file managerFinder/NautilusRust
rangerTerminal file managerFinder/NautilusPython
nnnMinimal file managerFinder/NautilusC
brootTree + fuzzy browsertree + findRust

Where to Start

These three tools cover 90% of file search and navigation needs:

  1. fzf — install it and set up the shell integration (Ctrl+T, Ctrl+R, Alt+C). This alone transforms your terminal workflow.
  2. fd — pair it with fzf for file finding, use it standalone for quick searches.
  3. zoxide — after a few days of learning your directories, you'll never type a full path again.

Add ripgrep if you search through code, and a file manager (yazi or ranger) if you browse files visually.

For the complete list of developer tools, see Best CLI Tools for Developers and The Developer's Terminal Setup Guide.


FAQ

Is fzf a file finder?

Not exactly. fzf is a general-purpose fuzzy finder — it takes any list of items as input and provides an interactive, fuzzy-searchable interface. Finding files is its most common use, but it works equally well for git branches, command history, process lists, or any text input. It's a building block, not a single-purpose tool.

Should I use fd or find?

Use fd for interactive work — it's faster, has better defaults, and the syntax is simpler. Keep find knowledge for scripts that need to run on servers without fd installed, and for the rare cases where you need a feature fd doesn't have (like -exec with complex logic, though fd supports basic -exec too).

What's the difference between yazi, ranger, and nnn?

yazi is the newest and fastest (Rust), with modern features like image previews and async file loading. ranger is the most customizable (Python), with the largest plugin ecosystem. nnn is the lightest (C), starting instantly with minimal overhead. All three use vi-style keybindings. Pick yazi for speed, ranger for customization, nnn for minimalism.

Can I use ripgrep inside my editor?

Yes. Most code editors use ripgrep as their search backend — VS Code, Neovim (via plugins), and others. When you use "Find in Files" in VS Code, it's running ripgrep under the hood. Installing ripgrep on your system makes these editor searches faster too.


Browse all file and search tools on clihub — the directory for discovering command line tools.

Find these tools on clihub

Browse install commands, star counts, and comparisons for every CLI tool mentioned in this article.

Related articles