fzf Recipes: Files, ripgrep, Git, Processes, and Navigation

Practical pipeline recipes that combine fzf with fd, ripgrep, bat, Git, and shell utilities.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## File and code recipes
Find project files with fd and fzf
fd --type f | fzf

# Use fd as the file source for faster recursive listing.

Search with ripgrep then open in Vim
rg --line-number --no-heading --color=always 'TODO|FIXME' | fzf --ansi | cut -d: -f1 | xargs -r vim

# Use ripgrep for content search and fzf for interactive selection.

Preview ripgrep matches with context
rg --line-number --no-heading --color=always 'auth' | fzf --ansi --delimiter=':' --preview 'bat --color=always --highlight-line {2} {1}'

# Combine ANSI results with a syntax-highlighted preview.

Pick and switch branches
git branch --all --color=always | sed 's/^..//' | fzf --ansi | xargs -r git switch

# Use fzf to choose a Git branch interactively.

Browse recent commits
git log --oneline --color=always | fzf --ansi --preview 'git show --color=always {1}'

# Preview commit details while selecting a hash.

Select and kill a process
ps -ef | sed 1d | fzf --nth=2.. --multi | awk '{print $2}' | xargs -r kill -15

# Pick a process from ps output and send it a signal.

## History and navigation recipes
Jump to a recent directory
printf '%s
' ~/src ~/work ~/notes | fzf | xargs -I{} cd '{}'

# Use a list of tracked directories as an interactive jump menu.

Browse man pages interactively
apropos . | fzf | awk '{print $1}' | xargs -r man

# Choose a command and open its man page.

Recommended next

No recommendations yet.