The interactive line picker
fzf reads stdin, shows an interactive prompt where you type to filter, and prints the selected line(s) on stdout. Once integrated into your shell, it transforms history search, file pickers, and process selection into a single muscle-memory.
Install + integrate
brew install fzf
$(brew --prefix)/opt/fzf/install # adds keybindings + completionThe installer adds three Ctrl bindings:
- Ctrl+R — fuzzy history search. Replaces the default. Type any substring; matches show; Enter to run.
- Ctrl+T — fuzzy file picker. Type at a prompt, hit Ctrl+T, pick a file, the path inserts into the command line.
- Alt+C — fuzzy cd into a subdirectory.
Standalone use
# Pick a process to kill
kill -9 "$(ps aux | fzf | awk '{print $2}')"
# Pick a git branch
git checkout "$(git branch | fzf | tr -d ' *')"
# Open a file in your editor
$EDITOR "$(fd | fzf)"Customizing
# Better defaults
export FZF_DEFAULT_OPTS="--height 40% --reverse --border --info=inline"
# Use fd for the file pickers (faster than find)
export FZF_DEFAULT_COMMAND='fd --type f --hidden --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"Why everyone falls in love with it
You stop typing complete filenames, complete branch names, complete PIDs. Fuzzy substring + arrow-key + Enter is faster than tab completion for almost every interactive selection task.