Favicon of fzf

fzf

A command-line fuzzy finder that filters files, history, and any text list, with shell and editor integrations.

fzf is a general-purpose fuzzy finder that runs in your terminal. Pipe any list into it (files, git branches, running processes, shell history, whatever you can generate as lines of text) and it opens an interactive filter where you type a few characters and narrow down to the match you want. It ships as a single binary with integrations for major shells and editors, so it fits into scripts and one-off interactive commands alike. It's built for developers and sysadmins who spend a lot of time at the command line and are tired of scrolling through long output by hand.

Key features

  • Fuzzy matching engine: matches items even when you type letters out of exact sequence, and supports an extended search syntax with prefix (^), suffix ($), exact quotes, negation (!), and OR (|) operators.
  • Portable single binary: distributed as one executable with no runtime or dependency to install before you can start using it.
  • Shell integration: key bindings for bash, zsh, fish, and Nushell add CTRL-T to paste selected files onto the command line, CTRL-R to search command history, and ALT-C to cd into a selected directory.
  • Fuzzy completion: trigger fuzzy path, process ID, hostname, and environment variable completion inline by typing ** before pressing Tab in bash, zsh, or fish.
  • Preview window: pipe the currently highlighted item into an external command (cat, bat, tree, and so on) and see live output in a split pane.
  • Flexible display modes: --height runs fzf inline below the cursor, --popup opens it in a floating window under tmux or Zellij, and the default is fullscreen.
  • Key and event bindings: bind keys to actions like reload, execute, become, and preview toggling, which makes it possible to build custom interactive tools directly on top of fzf.
  • Vim/Neovim plugin: a companion plugin (fzf.vim) adds a set of ready-made fuzzy commands for editing, and fzf#install() keeps the binary current.

Ideal use cases

fzf is a strong fit any time you'd otherwise be piping output into grep and scanning it by eye. Selecting a file to open in an editor, checking out a git branch, killing a stray process, replaying a long shell command from history, or building a custom picker for a script (say, choosing a Kubernetes pod or an SSH host) are all places where fzf turns a multi-step lookup into a few keystrokes. It also works well as the backbone of custom terminal UIs: because it reads from stdin and writes the selection to stdout, you can wrap it in shell functions for almost any workflow that starts with "pick one item from a list."

It is not a file indexer or a content search tool by itself. fzf filters whatever list you feed it; it doesn't walk the filesystem or search inside files unless you pair it with something like fd or ripgrep to generate that list. If you need to search file contents directly, ripgrep on its own is the better starting point, though the two combine well (fzf as the picker, ripgrep as the reload source). It also assumes a terminal environment: there's no GUI, so if you want a graphical fuzzy launcher this isn't the right tool.

Installation

fzf is available through most package managers. On macOS or Linux with Homebrew:

brew install fzf

On Linux distributions, common package managers work directly:

sudo apt install fzf      # Debian/Ubuntu
sudo dnf install fzf      # Fedora
sudo pacman -S fzf        # Arch Linux

On Windows, it's available via Chocolatey, Scoop, or Winget:

scoop install fzf

To install from source with git:

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

After installing through a package manager, set up shell integration by adding a line to your shell config:

# bash
eval "$(fzf --bash)"

# zsh
source <(fzf --zsh)

# fish
fzf --fish | source

This enables the CTRL-T, CTRL-R, and ALT-C key bindings along with fuzzy completion. Once set up, basic usage is as simple as piping a list into the fzf command:

find * -type f | fzf > selected
Categories:

Frequently asked questions

Share:

Stars
81.6K
Forks
2.8K
Last commit
3 days ago
Repository age
13 years
License
MIT
Self-hosted
No
Activity score
87/100
View Repository
Built with:

Similar to fzf

Favicon

 

  
  
Favicon

 

  
  
Favicon