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
Key Facts
- The most straightforward installation method uses `sudo apt install fzf`.
- Cloning the GitHub repository provides access to the latest features and customization.
- The install script can integrate fzf key bindings and fuzzy completion for your shell.
- You can customize fzf's appearance and behavior using environment variables and configuration files.
- fzf is a command-line fuzzy finder, significantly speeding up file and command searching.
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.
- 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- Install fzf: Once the package lists are updated, you can install fzf by running the following command:
sudo apt install fzfAfter 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.
- 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 ~/.fzfThe `--depth 1` flag ensures that only the latest commit is downloaded, saving time and disk space.
- 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/installThe 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.
- 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 ~/.bashrcFor Zsh, you would run:
source ~/.zshrcAfter 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.
More How To in Daily Life
Also in Daily Life
More "How To" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
Missing an answer?
Suggest a question and we'll generate an answer for it.