Fzf - File Search From Linux Terminal
Last Updated :
03 May, 2025
Fzf is a command-line general-purpose fuzzy finder tool. It is somewhat like grep. It is a cross-platform command-line tool, that helps you to search and open files quickly. Furthermore, it is open-sourced portable with no dependencies. It has supports for Vim/Neo vim plugin, key bindings, and fuzzy auto-completion. It can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc.
Install fzf via package managers or Git on Linux, macOS, Windows, or BSD.
| Package Manager | Linux Distribution | Command |
---|
1. | APK | Alpine Linux | sudo apk add fzf |
2. | APT | Debian 9+/Ubuntu 19.10+ | sudo apt-get install fzf |
3. | Conda | | conda install -c conda-forge fzf |
4. | DNF | Fedora | sudo dnf install fzf |
5. | Nix | NixOS, etc. | nix-env -iA nixpkgs.fzf |
6. | Pacman | Arch Linux | sudo pacman -S fzf |
7. | pkg | FreeBSD | pkg install fzf |
8. | pkg_add | OpenBSD | pkg_add fzf |
9. | XBPS | Void Linux | sudo xbps-install -S fzf |
10. | Zypper | openSUSE | sudo zypper install fzf |
Installation using Git
In this we install the fzf using the git:
Step 1: Open up the terminal and run the following command to see if git is installed on your machine or not.
git --version
If the output looks like this, then you are good to go, or else you need to install git first on your system. You can install git by running the following command:
sudo apt install git-all
Step 2: Clone the fzf repository using the following command:
git clone --depth 1 https://github.com/junegunn/fzf.git
cloning fzf repoStep 3: Navigate to the cloned folder.
cd fzf
Step 4: Run the installation script using the following command.
./install
installing fzfUsing fzf to search and open a file
nano is a text editor, and we are going to open the searched file in nano. And (fzf --height 40%) will open a fuzzy finder window within 40% of the screen.
nano $(fzf --height 40% )
Note: we can replace nano with other utility commands like cat(used to view a file), rm(used to remove a file), kill(used to kill a running process), cd( to change directory),etc.

In this example, we are opening a file called geeks.sh using a fuzzy finder prompt. We can use the keys to navigate through, or we can just type the name of the file that we are looking for.
We can use the keyboard key to navigate through the list of items/files.
- CTRL-J / CTRL-N to the move cursor down and CTRL-K/ CTRL-P to move the cursor up.
- Use any of these CTRL-C / CTRL-G / ESC key combinations to exit from the finder.
- To select multiple files run fzf as fzf -m i.e. multi-select mode (-m), and use TAB to mark multiple items/files.
- Use Mouse: scroll to scroll through items/files, right-click to multi-select the file, left-click/double-click to open the file.
Using multi-select mode
To select multiple files in finder, we open fzf in multi-select mode using -m argument. The red triangle in front of the items/files shows that these files are selected. After selecting desired files hit ENTER to display their path location.
fzf -m
selecting multiple filesSteps to Uninstall fzf
If you want to uninstall the fzf than follow the below steps:
Step 1: Navigate to fzf directory using following command:
cd fzf
Step 2: Use ls command to list all the items in that directory.
ls
listing all filesStep 3: Run the uninstallation file i.e. uninstall, from this fzf directory to remove the fuzzy finder from your system.
./uninstall
Successfully uninstalled fzfConclusion
fzf is the command-line fuzzy finder, revolutionizing the way developers, sysadmins, and Linux users work with their terminal processes. The open-source gem combines lightning-fast speed, fuzzy search wizardry, and easy integrations with applications like Vim, bash, zsh, and Git, all of which make it an indispensable tool for terminal productivity. Whether finding files with nano $(fzf --height 40%), handling processes, or batch editing with multi-select mode (fzf -m), fzf saves time and effort. Its cross-platform compatibility—Ubuntu, Fedora, macOS, Windows, and BSD included—and dependency-free nature.
Similar Reads
How to Search in Vim in Linux For many Linux users and developers, Vim is one of the most efficient and versatile text editors. Among its strong points is its search function, enabling users quickly to locate and re-arrange text within files. Here we will look at different ways and commands to search smartly in Vim on a Linux sy
5 min read
How to Open a File in Linuxâ In Linux, a file is a fundamental unit of storage, representing everything from documents and images to system logs and program data. Unlike traditional operating systems, Linux treats almost everythingâfiles, directories, devices, and processesâas a file. Whether you're accessing a simple text docu
6 min read
Searching Stack Overflow from Linux Terminal Using SoCLI Tool SoCLI is a command-line tool written in python used to search queries on the stack overflow. We can search anything on stack overflow using the SoCLI tool without using the terminal. You can search for any question on Stack overflow on the terminal using SoCLI tool. Installation of SoCLI: Let's see
4 min read
How to Find Recently Modified Files in Linux? Here we are going to see how to find recent or todayâs modified files in Linux. Locating files with a particular name is one of the problems Linux user's faces, it would be easier when you actually know the filename. let's assume that you have created a file in your home folder and you have forgotte
2 min read
Test Case For Search Functionality The search functionality of the software should allow users to search for specific content within the software. The search results should be displayed in a manner that is easy to understand and navigate. The article focuses on discussing test cases for the search functionality:Test Case For Search F
3 min read
How to Find Out File Types in Linux In Linux, everything is considered as a file. In UNIX, seven standard file types are regular, directory, symbolic link, FIFO special, block special, character special, and socket. In Linux/UNIX, we have to deal with different file types to manage them efficiently.Categories of Files in Linux/UNIXIn
7 min read
List One Filename Per Line in Linux One of the most frequent tasks when using the Linux command line is listing the files in a directory. Sometimes we want the list of files to be in a specific format, such as one file per line. ls is a Linux shell command that lists directory contents of files and directories. It is one of the most o
3 min read
How to Get the Full Path of a File in Linux While dealing with files on Linux, especially shell scripts, one may require determining the full path of a file at times. Now, let's consider several methods of getting the full path of a file in Linux. In this article, we will be discussing several different solutions to a popular problem.Before w
3 min read
How To Show Only Filenames with grep on Linux In Linux, the 'grep' command is one of the most used commands by many administrators to perform the advanced search of text within the files. Grep is one of the important text-search commands in Unix-based operating systems. We can also use this command to filter and simultaneously display the list
5 min read
How to Search in Nano Editor? The Nano editor is a command-line text editor widely used in Unix-like operating systems, including Linux and macOS. Despite its simplicity, it offers a powerful search functionality that allows users to quickly locate and navigate to specific text within a file. Mastering the search feature in Nano
6 min read