Bash command line :: fzf

FZF is quite a nifty tool that integrates into your command line shell and provides a lookup / shortcut facility, similar to the “tab” auto-complete but more extensive.


It appears in most modern distributions, however the distro versions can be quite out of date, so you might prefer to install it directly from the git repository.

git clone --depth 1 ~/.fzf

Once you’e done this, you may need to restart your terminal session for the changes to kick in, but once active you’ll have access to a number of new shortcuts.


So when you’re looking to list the files in a given location, you can now list a double asterisk as the location, then hit tab, and it will give you an altogether new and different auto-complete experience;

Screenshot from 2024-04-20 12-48-37

What it will offer you is a cursor key operated list of possibilities, and as you type, it will narrow down the search list.

Screenshot from 2024-04-20 12-49-00

Now this is really quick, there are 250,000 files in my home folder and it scanned them all in a second or two. Select the file you want, then hit return.

(any command) CTRL+T

For example, type in “vi” then CTRL+T (not literally, hold down control and press T) and it will pop up the same sort of selection.

(any command) ALT+C

As per CTRL+T but just lists folders (directories). Note that both CTRL+T and ALT+C work “without” a command if you just want to browse files or folders.


So cd works in the same way as “ls”, the difference is that the list offered consists only of folders with files excluded.

Screenshot from 2024-04-20 12-55-57

Other than the graphical element, what makes this so interesting is that is the recursive nature of the listing and the fact you can interactively search before making a selection. i.e. it doesn’t list all the folders in your current folder, it lists all the folders in the tree of folders “under” your current folder.


Now I hear you ask, how can you make “kill” more interesting … well, how about like this, type “kill **” then hit tab;

Just select the process you want to kill and hit return. If you want to get a little more from it, there are key combinations that will let you select a number of processes if you want to kill more than one.


Yup, it does ssh too! Try typing “ss **” then tab;

Screenshot from 2024-04-20 13-01-02

Same principle, select the host you want to ssh to and hit return. It looks like this is fed from recent hosts. Although I’ve not checked where it’s getting it’s history from, given it’s showing 80 for me, it’s doing more than looking in .ssh/config.


fzf is a flexible addition to modern shells that enhances file and folder selection. If you do a lot of command line work, maybe worth a look.

  • I don’t really use the terminal shell
  • I only use standard tools
  • I don’t really want the hassle of adding new tools
  • I might take a look at this to see if it’s useful
  • That looks really handy
0 voters

…but can one uninstall it if need be?

Ok, so assuming you take the git approach, it installs two things;

  • a new line in your ~/.bashrc (which you can delete)
  • .fzf (which is the git repository)

So to deactivate, remove the line from the bottom of ~/.bashrc and restart your shell(s). To remove entirely, remove ~/.fzf

It’s a relatively common way of installing local software on a per-user basis. Other popular examples would be pyenv (for python) and nvm for Node.js.


Many thanks.
I feel more comfortable experimenting if I know I can go back to how things were.