Skip to content

:search: fzf

fzf is a general-purpose command-line fuzzy finder. It's an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc.

🛠 Installation

fzf can be installed using the system's package manager.

sudo apt update && \
sudo apt install -y fzf
sudo apt update && \
sudo apt install -y fzf

⚙ Shell Integration

To enable key bindings and fuzzy completion, add the following to your shell configuration file.

Add to ~/.bashrc:

eval "$(fzf --bash)"

Add to ~/.zshrc:

source <(fzf --zsh)

📝 Usage

After setting up shell integration, you can use the following key bindings:

  • Ctrl+R: Fuzzy search command history.
  • Ctrl+T: Fuzzy search files in the current directory and paste the path to the command line.
  • Alt+C: Fuzzy search subdirectories and cd into the selected one.

Examples

Kill a process:

kill -9 **<TAB>

SSH to a host:

ssh **<TAB>

Search environment variables:

env | fzf

🚀 Upgrade

sudo apt update && \
sudo apt upgrade fzf

🔗 References