fzf Install, Upgrade, and Shell Integration

Install fzf, enable shell integration, and configure global defaults for day-to-day use.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Install and verify

Install fzf, check the version, and inspect built-in docs.

Install with Homebrew

Install fzf on macOS or Linux with Homebrew.

bashANYinstallbrewmacoslinux
bash
brew install fzf

Homebrew is the most common install path on macOS and also works on Linux.

Install with apt

Install fzf from Debian or Ubuntu repositories.

bashANYinstallaptubuntudebian
bash
sudo apt-get install -y fzf

Fastest way to get started on Debian-based systems, though package versions can lag behind upstream.

Install with pacman

Install fzf on Arch Linux.

bashANYinstallpacmanarch
bash
sudo pacman -S fzf

Simple install path on Arch and Arch-based systems.

Install from the upstream repository

Clone the repo and run the installer for shell integration.

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

The install script can add shell key bindings and completion for supported shells.

Check the installed version

Print the current fzf version.

bashANYversionverify
bash
fzf --version

Useful for troubleshooting option availability and verifying an upgrade.

Open the embedded manual

Show the built-in man page from the binary.

bashANYmanualhelpdocs
bash
fzf --man

Recent versions embed the manual directly in the binary, which is convenient on minimal systems.

Shell integration

Enable fuzzy completion and common shell key bindings.

Source zsh integration

Load fzf key bindings and completion in zsh.

bashANYzshcompletionkey-bindings
bash
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

Typical setup when installed via the upstream installer.

Source bash integration

Load fzf key bindings and completion in bash.

bashANYbashcompletionkey-bindings
bash
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

Adds key bindings such as CTRL-T and CTRL-R in bash.

Set a better default file source

Use fd instead of find for faster file listings.

bashANYfddefault-commandfiles
bash
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'

A common optimization because fd is faster and easier to tune than raw find.

Define global default options

Apply common options to every fzf invocation.

bashANYdefault-optslayoutui
bash
export FZF_DEFAULT_OPTS='--height=40% --layout=reverse --border --info=inline'

Handy for keeping your preferred layout and UI style consistent.

Customize CTRL-T picker

Tune the file picker bound to CTRL-T.

bashANYctrl-tpreviewshell-integration
bash
export FZF_CTRL_T_OPTS='--preview "bat --style=numbers --color=always --line-range :200 {}"'

Adds a preview window for the built-in file selection binding.

Recommended next

No recommendations yet.