terminal-life:~$

fzf — a fuzzy finder for everything

Pipe any list of anything into fzf, type a few letters, pick a line, do something with it. That’s the whole idea — and it changes how you use the shell.

Fzf (fuzzy finder) reads a list of lines from stdin, shows them in an interactive picker with a search prompt, and prints the line you chose to stdout. That stdin-to-stdout loop is why it composes with everything you already use. You can fuzzy-find a file and open it, a git branch and check it out, a process and kill it, a command from your history and re-run it. It doesn’t replace your tools; it puts a fast, forgiving interface in front of them. The killer detail: the search is fuzzy, so dgcm matches docker-compose.yml. You stop remembering exact names and start remembering shapes.

//install

# macOS
brew install fzf
# Debian/Ubuntu
sudo apt install fzf
# Fedora
sudo dnf install fzf
# Arch
sudo pacman -S fzf
# or grab the static binary from GitHub releases

//examples

# Fuzzy-find a file under the current dir and open it in $EDITOR
nvim "$(fzf)"

# Check out a git branch without typing its full name
git checkout "$(git branch | fzf)"

# Kill a process by fuzzy-matching its name
kill "$(ps aux | fzf | awk '{print $2}')"

# Re-run a piped command after picking a history entry
eval "$(fc -l 1 | fzf | cut -c8-)"

# Preview files while browsing (right pane shows content)
fzf --preview 'bat --color=always {}'

# Bind Ctrl-R to fzf history search and Ctrl-T to file search
eval "$(fzf --bash)"   # use: fzf --zsh or fzf --fish instead

//pro tip

Fzf matches in any order, but you can force anchoring with a leading apostrophe: 'docker matches “docker” as a prefix, while docker alone matches it anywhere. Combine anchored terms to slash a 50,000-file list to one candidate in a few keystrokes: 'src 'test .yml.

//honest limits

Fzf is only as good as the list you feed it — it searches lines, not file contents (use ripgrep for that). On huge directory trees the file-listing step, not fzf itself, is the bottleneck. And the keybinding setup above assumes a recent fzf; older versions shipped a separate install script.