How to install fzf in ubuntu

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: To install fzf on Ubuntu, you can use the package manager with `sudo apt update && sudo apt install fzf`. Alternatively, you can clone the official repository and run the install script for more customization options, which also integrates fzf with your shell.

Key Facts

Overview

fzf is a powerful, interactive command-line fuzzy finder that can significantly enhance your productivity when navigating files, directories, and command history on your Ubuntu system. It allows you to quickly search for items using partial or misspelled names, presenting results in a real-time, interactive list. This makes it an invaluable tool for developers, system administrators, and anyone who spends a lot of time working in the terminal.

Installing fzf on Ubuntu is a relatively simple process. There are two primary methods: using the Ubuntu package manager (APT) for a quick and stable installation, or cloning the official repository from GitHub for the latest features and greater control over the installation process. Both methods are effective, and the best choice often depends on your specific needs and comfort level with the command line.

Installing fzf using APT

The easiest and most common way to install fzf on Ubuntu is by using the Advanced Package Tool (APT), Ubuntu's default package manager. This method ensures you get a stable version of fzf that is well-integrated with your system.

  1. Update Package Lists: Before installing any new software, it's good practice to update your local package index to ensure you're getting the latest available version. Open your terminal and run:
sudo apt update
  1. Install fzf: Once the package lists are updated, you can install fzf by running the following command:
sudo apt install fzf

After the installation is complete, fzf will be available in your system's PATH, and you can start using it immediately. For example, you can type `fzf` into your terminal to start the interactive finder.

Installing fzf from Source (GitHub)

If you want the absolute latest version of fzf, or if you want to customize the installation process, installing from the official GitHub repository is the way to go. This method also allows you to easily set up shell integrations.

  1. Clone the Repository: First, you'll need to clone the fzf repository from GitHub. Make sure you have Git installed (`sudo apt install git` if you don't). Then, navigate to a directory where you want to store the fzf files (e.g., your home directory or a development folder) and run:
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf

The `--depth 1` flag ensures that only the latest commit is downloaded, saving time and disk space.

  1. Run the Install Script: Once the repository is cloned, navigate into the cloned directory and run the install script. This script will prompt you with several questions about how you want to configure fzf.

    ~/.fzf/install

    The install script typically asks if you want to:

    • Enable fuzzy auto-completion.
    • Enable key bindings (Ctrl+T, Ctrl+R, Alt+C).
    • Update your shell configuration file (e.g., `.bashrc`, `.zshrc`).

    It is generally recommended to say 'yes' to these options for the best experience. The script will automatically detect your shell and modify the appropriate configuration file.

    1. Restart Your Shell or Source the Config: For the changes made by the install script to take effect, you need to either close and reopen your terminal, or reload your shell's configuration file. For Bash, you would run:
    source ~/.bashrc

    For Zsh, you would run:

    source ~/.zshrc

    After this, you should be able to use fzf and its associated key bindings.

    Using fzf

    Once installed, fzf can be used in several ways:

    • Basic Usage: Simply typing `fzf` in your terminal will launch an interactive finder for files and directories in the current directory.
    • Command History: The `Ctrl+R` key binding (if enabled during installation) allows you to fuzzy search your command history.
    • File Finder: The `Ctrl+T` key binding (if enabled) allows you to fuzzy find any file or directory from the current directory downwards.
    • Directory Change: The `Alt+C` binding (if enabled) allows you to quickly change directory by fuzzy finding a target directory.

    fzf is highly configurable. You can set environment variables like `FZF_DEFAULT_COMMAND` to change the command used to populate the list (e.g., using `fd` or `ripgrep` for faster searching) and `FZF_DEFAULT_OPTS` to customize its appearance and behavior.

    Troubleshooting

    If fzf is not working after installation, ensure that you have sourced your shell's configuration file or restarted your terminal. If you installed from source and encountered errors, double-check that you have the necessary build tools installed (`sudo apt install build-essential`). For APT installations, ensure your package lists are up-to-date.

Sources

  1. fzf - A command-line fuzzy finderMIT
  2. fzf package details (Ubuntu)fair-use

Missing an answer?

Suggest a question and we'll generate an answer for it.