fzf: the fuzzy finder we keep reaching for in the terminal

One command-line tool earns a place on every machine we set up. It is a fuzzy finder called fzf. Install it, learn three keybindings, and reclaim an hour of your week.

AI-generated conceptual editorial image of one vermilion card selected from a sunlit analog archive

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.

Where to learn more

Install fzf today. You will wonder what you were doing before.