fzf Basics: Search, Select, and Script Output

Core fzf usage patterns for filtering lists, selecting items, and integrating the result into shell workflows.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Core usage
Select files from a pipeline
find . -type f | fzf

# Pipe any list into fzf and interactively pick a line.

Open the selected file in an editor
vim "$(find . -type f | fzf)"

# Capture the selected value and open it with $EDITOR.

Enable multi-select
find . -type f | fzf -m

# Pick multiple lines instead of a single match.

Use exact matching
ps -ef | fzf --exact

# Turn off fuzzy matching and only match the query literally.

Match on specific fields
ps -ef | fzf --nth=1,8..

# Restrict matching to selected delimited fields.

Transform what is displayed
ps -ef | fzf --nth=1,8.. --with-nth=8..

# Hide or reorder fields in the list without changing the selected line.

Set a custom field delimiter
cut -d: -f1,3 /etc/passwd | fzf --delimiter=':' --with-nth=1

# Parse colon- or tab-delimited input cleanly.

## Query and output control
Start with a prefilled query
git branch --all | fzf --query='feature/'

# Open fzf with an initial search string.

Auto-accept single matches
find . -type f | fzf --select-1 --exit-0

# Accept immediately when there is exactly one match.

Run in non-interactive filter mode
printf '%s
' alpha beta gamma | fzf --filter=gm

# Use fzf as a fuzzy filter without opening the UI.

Recommended next

No recommendations yet.