Skip to main content

Installation and First Run

fzf is available via package managers on every major platform and as a single Go binary. The git-based install also sets up shell integration automatically.

Installation Methods

Method 1: Package Managers (Quickest)

# Debian / Ubuntu
sudo apt update && sudo apt install -y fzf

# RHEL / CentOS / Rocky / Alma
sudo dnf install -y fzf
# or for older RHEL:
sudo yum install -y fzf

# Arch Linux
sudo pacman -S fzf

# macOS (Homebrew)
brew install fzf

# Alpine Linux
apk add fzf

# NixOS / nix-env
nix-env -iA nixpkgs.fzf
warning

Package manager versions may lag behind the upstream release. For the latest features (especially --tmux flag and --with-nth improvements), prefer the git install.

# Clone the repo
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf

# Run the install script
~/.fzf/install

The installer asks three questions:

Do you want to enable fuzzy auto-completion? ([y]/n) y
Do you want to enable key bindings? ([y]/n) y
Do you want to update your shell configuration files? ([y]/n) y

Answering y to all automatically adds fzf to your ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish.

Method 3: Pre-built Binary (Servers Without Git)

# Get the latest release version number
FZF_VERSION=$(curl -s https://api.github.com/repos/junegunn/fzf/releases/latest \
| grep '"tag_name"' | cut -d'"' -f4 | tr -d 'v')

# Download for Linux x86_64
curl -LO "https://github.com/junegunn/fzf/releases/download/v${FZF_VERSION}/fzf-${FZF_VERSION}-linux_amd64.tar.gz"

# Extract and install
tar xzf "fzf-${FZF_VERSION}-linux_amd64.tar.gz"
sudo mv fzf /usr/local/bin/

# Verify
fzf --version

Method 4: Homebrew on Linux (Linuxbrew)

brew install fzf
# Follow post-install instructions to set up shell integration:
$(brew --prefix)/opt/fzf/install

Verifying Installation

# Check version
fzf --version
# Expected output: 0.58.0 (or newer)

# Quick test — interactive filter from input
echo -e "apple\nbanana\ncherry\ndate\nelderberry" | fzf

# Should open a TUI. Type "a" to filter, Enter to select.

Shell Integration Setup

If you used the git install, shell integration is already configured. For package manager installs, add manually:

Bash

~/.bashrc
# Load fzf shell integration
eval "$(fzf --bash)"

Zsh

~/.zshrc
# Load fzf shell integration
eval "$(fzf --zsh)"

Fish

~/.config/fish/config.fish
fzf --fish | source

Manual Integration (for older fzf versions)

~/.bashrc
# Key bindings
source /usr/share/doc/fzf/examples/key-bindings.bash

# Fuzzy auto-completion
source /usr/share/doc/fzf/examples/completion.bash
tip

After editing your shell config, restart your shell or run source ~/.bashrc / source ~/.zshrc to activate the integration.

Quick Functionality Check

# 1. File picker (CTRL-T in shell)
ls /etc | fzf

# 2. History search (CTRL-R in shell)
# Press CTRL-R in your terminal

# 3. Directory jump (ALT-C in shell)
# Press ALT-C in your terminal

# 4. Open selected file in editor
vim $(ls | fzf)

# 5. Multi-select (Tab to mark, Enter to confirm)
ls | fzf -m

These tools dramatically improve the fzf experience:

# bat — syntax-highlighted file previews
sudo apt install -y bat
# On Ubuntu, the binary may be named 'batcat'
ln -s $(which batcat) ~/.local/bin/bat # create alias

# fd — faster, friendlier find (fzf uses it as default source)
sudo apt install -y fd-find
ln -s $(which fdfind) ~/.local/bin/fd

# ripgrep — faster grep, used as input source for text search
sudo apt install -y ripgrep

# delta — syntax-highlighted git diffs
cargo install git-delta
# or: sudo apt install git-delta

# tree — directory structure preview
sudo apt install -y tree

Set fd as fzf's default source:

~/.bashrc or ~/.zshrc
# Use fd instead of find for fzf's default file listing
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"

What's Next