fzf is a command-line fuzzy finder. It takes input on stdin, shows you an interactive narrowing list, and prints your selection on stdout. That sounds simple. It changes how you use the terminal.
After 10 minutes with fzf you stop typing full file paths, full branch names, full cd paths, full command-history lookups. You type three letters and hit Enter.
Install
macOS (Homebrew)
brew install fzf
# Install the key bindings and fuzzy completion for your shell
$(brew --prefix)/opt/fzf/install
The post-install script asks if you want key bindings (yes) and fuzzy completion (yes). It will append the right lines to your .zshrc or .bashrc.
Linux
# Ubuntu / Debian
sudo apt install fzf
# Arch
sudo pacman -S fzf
# Or clone and build from source (recommended for latest)
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
Windows
winget install fzf
# or
scoop install fzf
Verify:
fzf --version
How we actually use it
1. Ctrl+R for history
Once the key bindings are installed, press Ctrl+R in your shell:
$ (Ctrl+R)
> docker compose up █
docker compose up
docker compose down --volumes
docker compose logs -f api
docker system prune -a
...
Type a few letters of any previous command. Arrow keys to pick. Enter to run. This replaces scrolling through thousands of lines of history, forever.
2. Ctrl+T for files
$ vim (Ctrl+T)
> content/log4j/ █
app/components/log4j/log4j-feed.vue
app/components/log4j/log4j-stream.vue
content/log4j/claude-4-7-opus-what-actually-improved.md
...
Narrows to the file you want, inserts the path into the current command, press Enter.
3. Alt+C for directories
$ (Alt+C)
> src/comp █
./app/components/log4j
./app/components/home
./app/composables
Jumps straight into the directory. Replaces half of your cd muscle memory.
4. Pipe anything into fzf
# Check out a branch
git branch -a | fzf | xargs git checkout
# Kill a process
ps aux | fzf | awk '{print $2}' | xargs kill -9
# Pick a Kubernetes pod
kubectl get pods | fzf | awk '{print $1}' | xargs -I {} kubectl logs -f {}
# Preview markdown files while narrowing
fzf --preview 'bat --color=always {}' --preview-window=right:60%
The trick: anything that produces lines can be piped into fzf. Anything fzf returns can be piped forward.
5. Git integration
Add to your .zshrc:
# Fuzzy-find a branch and check it out
gco() {
git branch -a | grep -v HEAD | sed 's|remotes/origin/||' | sort -u | fzf | xargs git checkout
}
# Fuzzy-find a commit and show it
glog() {
git log --oneline --graph --all | fzf --preview 'echo {} | grep -oE "[a-f0-9]{7,}" | head -1 | xargs git show --color=always'
}
Now gco gives you a fuzzy branch picker, glog gives you an interactive log browser.
Recommended config
In your .zshrc:
# Use fd for file/dir listing — respects .gitignore
export FZF_DEFAULT_COMMAND='fd --type f --hidden --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND='fd --type d --hidden --exclude .git'
# Nicer defaults
export FZF_DEFAULT_OPTS="
--height=60%
--layout=reverse
--border
--info=inline
--preview-window=right:60%:wrap
--bind 'ctrl-/:toggle-preview'
--color=bg+:#2A2723,fg+:#E7E5D2,hl:#FF3D21,hl+:#FF3D21,prompt:#FF3D21,pointer:#FF3D21
"
You will end up hitting Ctrl+R instead of the up-arrow within a day and never go back.
Where to learn more
- Repo: github.com/junegunn/fzf
- Wiki / examples: github.com/junegunn/fzf/wiki
- fzf.vim plugin: github.com/junegunn/fzf.vim for Vim / Neovim integration
- fzf-tab for zsh tab-completion: github.com/Aloxaf/fzf-tab
Install fzf today. You will wonder what you were doing before.


