fzf — Blazing Fast Command-Line Fuzzy Finder
fzf is a general-purpose command-line fuzzy finder written in Go. Blazing fast, portable, and composable with any list-producing command. Interactive picker for files, commands, history, git branches, processes, and more.
What it is
fzf is a general-purpose command-line fuzzy finder written in Go. It reads any list from stdin and presents an interactive fuzzy search interface. You type a partial match, and fzf instantly narrows the list. It works with files, command history, git branches, processes, environment variables, and any command that produces text output.
fzf targets anyone who works in the terminal. It integrates with bash, zsh, and fish shells to enhance Ctrl+R history search, file finding, and directory navigation. The tool is composable with any Unix command through pipes.
How it saves time or tokens
fzf replaces manual searching through long command histories, directory trees, and process lists. Instead of typing exact names, you type partial fragments and fzf finds matches instantly. Shell integration replaces the default Ctrl+R with a fuzzy-searchable history. The preview window shows file contents or command details without leaving the picker.
How to use
- Install fzf:
brew install fzfon macOS,sudo apt install fzfon Ubuntu, or clone from GitHub. - Run
fzfin any directory to fuzzy-find files, or pipe any command output to fzf. - Enable shell integration for enhanced Ctrl+R, Ctrl+T, and Alt+C keybindings.
Example
# Interactive file finder
fzf
# Search command history (with shell integration)
# Press Ctrl+R to activate
# Find and open a file in vim
vim $(fzf)
# Git branch checkout with preview
git branch | fzf --preview 'git log --oneline {}' | xargs git checkout
# Kill a process interactively
ps aux | fzf | awk '{print $2}' | xargs kill
# Find files with preview
fzf --preview 'cat {}' --preview-window=right:60%
# Combine with ripgrep for content search
rg --files | fzf --preview 'head -50 {}'
Related on TokRepo
- Automation Tools — CLI productivity tools
- Coding AI Tools — Developer productivity tools
Common pitfalls
- Shell integration must be explicitly enabled after installation. Run the install script or source the keybinding files in your shell config.
- fzf uses an external file finder (find or fd) for directory traversal. Install fd for faster file finding and better .gitignore support.
- The default fzf command searches the current directory recursively. In large directories, set FZF_DEFAULT_COMMAND to use fd or rg for faster results.
Frequently Asked Questions
After installing fzf, run the install script that enables keybindings: ~/.fzf/install or eval $(fzf --bash) in .bashrc. This adds Ctrl+R for history search, Ctrl+T for file finding, and Alt+C for directory jumping.
Yes. Pipe any command to fzf and it becomes an interactive picker. Examples: docker ps | fzf, kubectl get pods | fzf, env | fzf. Any text list works.
The --preview flag runs a command for the currently highlighted item and displays the output in a split pane. Use it to preview file contents, git diffs, or command help without leaving the picker.
fzf is a terminal-based fuzzy finder, while dmenu and rofi are graphical menu selectors. fzf integrates with shell workflows and pipes. dmenu/rofi are better for desktop launcher use cases.
Yes. Use the -m flag to enable multi-select mode. Press Tab to select items and Enter to confirm. The selected items are output one per line.
Citations (3)
- fzf GitHub— fzf is a general-purpose fuzzy finder written in Go
- fzf README— fzf shell integration and keybinding configuration
- fzf Wiki— Command-line productivity tools and fuzzy finding
Related on TokRepo
Discussion
Related Assets
HumHub — Open-Source Enterprise Social Network
A flexible, open-source social networking platform built on Yii2 for creating private communities, intranets, and collaboration spaces within organizations.
Dolibarr — Open-Source ERP & CRM for Business Management
A modular open-source ERP and CRM application written in PHP for managing contacts, invoices, orders, inventory, accounting, and more from a single web interface.
PrestaShop — Open-Source PHP E-Commerce Platform
A widely adopted open-source e-commerce platform written in PHP with a rich module marketplace, multi-language support, and a strong European user base.