fzf Cheatsheet
0.57Fuzzy find everything
Fuzzy finding everything — files, history, processes, and more
Official docs →Last updated: 2026-03-29
fzf is a fuzzy finder for your terminal, and once you start using it, you'll wonder how you ever survived without it. Pipe anything into it — file lists, git branches, process IDs, environment variables, literally any line-based input — and fzf gives you an instant, interactive, typo-forgiving search interface. It turns "scroll through 400 lines of output squinting at each one" into "type three characters and you're there."
The beauty of fzf is that it's a Unix filter. It reads lines from stdin, lets you pick one (or many), and writes your selection to stdout. That's it. That simple contract means it plugs into everything. Combine it with find, rg, git, ps, docker, or anything else that produces text, and you've got an interactive selector for free. It's the duct tape of terminal workflows — except it's actually elegant.
This cheatsheet focuses on the patterns you'll use constantly: the core commands, the shell integrations that'll change how you navigate your filesystem, the preview window that makes selections feel luxurious, and the real-world recipes that turn fzf from "neat toy" into "essential infrastructure." If you only learn three things here, make it Ctrl-R, Ctrl-T, and the --preview flag. Everything else is gravy.
Basic Usage
The fundamentals. Most people start here and never realize how deep the rabbit hole goes.
Search Syntax
fzf's search language is small but surprisingly powerful. You can combine these tokens in a single query.
Key Bindings Inside fzf
Once fzf is open, these keys control navigation and selection.
Shell Integrations
These are the three bindings that make fzf feel like a superpower. They wire directly into your shell and work out of the box after installation.
Preview Window
The preview window turns fzf from a selector into a full browser. You can preview files, syntax-highlighted code, images, git diffs — anything you can pipe through a command.
Common Patterns
These are the copy-paste recipes that make fzf indispensable. Each one solves a real problem you've probably hit this week.
Tips
Set FZF_DEFAULT_COMMAND to use fd or rg instead of the default find. They're faster, respect .gitignore, and skip junk like node_modules automatically. Try export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' in your shell profile.
Customize the shell integrations independently with FZF_CTRL_T_COMMAND, FZF_CTRL_R_OPTS, and FZF_ALT_C_COMMAND. For example, set FZF_ALT_C_COMMAND='fd --type d' so Alt-C uses fd for blazing-fast directory search and automatically ignores .gitignore entries.
Put your default fzf options in FZF_DEFAULT_OPTS so they apply everywhere. A solid starting point: export FZF_DEFAULT_OPTS='--height 40% --reverse --border --preview-window right:50%:wrap'. This gives you a compact, top-down layout with a preview pane on every invocation.
Use --bind to add custom actions. For instance, --bind 'ctrl-y:execute-silent(echo {} | pbcopy)' copies the current selection to your clipboard without leaving fzf. You can bind any key to execute, reload, preview, or change fzf's behavior on the fly.
The --preview command has access to placeholders: {} is the full line, {1} is the first field, {q} is the current query, and {n} is the line number. These let you build surprisingly sophisticated previews without writing a wrapper script.
Chain fzf with --header to give your custom scripts user-friendly context. Something like git branch | fzf --header "Switch to branch:" makes throwaway scripts feel polished. Pair it with --prompt to customize the search prompt text too.
In tmux, fzf can open in a popup instead of inline. Use fzf-tmux -p 80%,60% to launch fzf in a centered floating popup window. It's slick, stays out of your main pane, and disappears when you're done. Once you try it, inline fzf feels cramped.