How to install fzf on macOS and Linux: fuzzy file and history search
Install fzf, enable shell integration, and use Ctrl+T and Ctrl+R to fuzzy-search files and command history.
Digging through folders, hunting a config path, or hammering the up arrow for yesterday's command — fzf turns any list into a fuzzy, filterable picker in the terminal.
People searching how to install fzf on macOS and Linux want a checkable path: install, remember a few keys, search files and shell history. Steps follow the official junegunn/fzf repository.
What fzf is for
Fuzzy match — no full path memorized
Type conf nginx and still hit /etc/nginx/nginx.conf. Subsequence matching beats typing the whole tree.
Embedded in the shell
The official install script wires bash, zsh, and fish with Ctrl+T, Ctrl+R, and Alt+C. Results land on the command line or change directory in place.
Any list source
Default listing uses find; swap in fd, rg --files, or pipe git branch | fzf. fzf only filters and selects.
Install on macOS and Linux
-
1
macOS: Homebrew plus the install script
Run
brew install fzf, then$(brew --prefix)/opt/fzf/install. Say yes to key bindings and fuzzy completion on first run. Restart the terminal orsource ~/.zshrc. -
2
Debian / Ubuntu: package or upstream binary
Quick path:
sudo apt update && sudo apt install fzf. For a newer build, grab a release binary from GitHub orgit cloneand run./install --all. Confirm withfzf --version. -
3
Fedora, Arch, and others
Fedora:
sudo dnf install fzf. Arch:sudo pacman -S fzf. Then run the distro notes or the officialinstallscript so bindings land in your shell config. -
4
Smoke-test the three default shortcuts
In zsh or bash:
Ctrl+Tpicks files,Ctrl+Rsearches history,Alt+C(Option+C on some Mac layouts) jumps into a directory. If nothing fires, check forsource .../fzf.zshorfzf-key-bindings.zshin your rc file.
Keys worth memorizing
| Key | Action | Typical use |
|---|---|---|
Ctrl+T |
Fuzzy file pick, insert on the line | Paths, configs, attachments |
Ctrl+R |
Fuzzy shell history | Recover long one-off commands |
Alt+C |
Pick a directory and cd |
Hop around a repo tree |
↑ / ↓ |
Move in the list | Navigate candidates |
Enter |
Confirm | Insert or run selection |
Esc |
Cancel | Return to the prompt |
File search: default find and faster backends
Running fzf alone lists files via FZF_DEFAULT_COMMAND or built-in find. Large trees benefit from fd or rg --files in ~/.zshrc:
# fd-backed listing (install fd first)
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# or ripgrep file listing
# export FZF_DEFAULT_COMMAND='rg --files --hidden --follow'
Pipes work too: git ls-files | fzf limits to tracked files; ls *.md | fzf | xargs cat hands the pick to the next command. When you need to sync on what you found, open a browser room from the wbroom homepage — steps in create and join a room.
Command history: Ctrl+R and retention
Ctrl+R reads the shell's HISTFILE. If history feels short, raise HISTSIZE / SAVEHIST (zsh) or HISTSIZE / HISTFILESIZE (bash). Interactive fzf history beats stepping one entry at a time — type a fragment and narrow.
fzf is not a replacement tool — it is a terminal filter. Any command that prints lines can feed
| fzffor interactive selection.
- Installed but no shortcuts
- You likely skipped the official
installscript or neversourcedfzf.zsh/fzf.bash. Open a fresh terminal and retry. - Search feels slow
- Point
FZF_DEFAULT_COMMANDatfdor a narrower root; excludenode_modulesand.git. - IDE embedded terminal
- Some IDE preview terminals do not forward
Ctrl+T. Verify bindings in Terminal.app, iTerm2, or Kitty.
Questions worth checking
How does fzf relate to ripgrep and fd?
fzf handles interactive filtering; ripgrep (rg) and fd produce candidate lists faster. They are often combined, not interchangeable.
Does it run on Windows?
Yes — Git Bash, WSL, and native Windows builds are documented upstream. This guide focuses on macOS and Linux terminals.
How do I remove it or turn off bindings?
Uninstall via your package manager and delete source ... fzf lines from ~/.zshrc or ~/.bashrc. The official install --uninstall path is in the current README.
Can I pick multiple files?
Yes. Pass --multi, mark rows with Tab, and Enter prints several lines for batch commands.