---
tags:
- cli
- l1
- flashcard-deck
- fzf
---
<!-- wiki:breadcrumb:start -->
[Portal](../../../../library/portal/index.md) | **Level:** [L1: Foundations](../../../../library/portal/levels.md) | **Topics:** [fzf](../../../../library/portal/topics.md) | **Domain:** CLI Tools
<!-- wiki:breadcrumb:end -->

id	category	difficulty	tags	question	answer	source_path
fzf/a1b2c3d4e5f6	fzf	easy	fzf, search, basics	What is fzf and how does it enhance command-line workflows?	fzf is a command-line fuzzy finder that reads lines from stdin and presents an interactive, filterable selection menu. It turns any list into a searchable picker.\n\nWho made it: Junegunn Choi created fzf in 2013. Written in Go, ~65K GitHub stars.\n\nName origin: fzf = FuZzy Finder. The double-z is intentional branding.\n\nAnalogy: fzf is to text lists what Spotlight is to macOS — instant fuzzy search over any content.	training/library/topics/fzf/primer.md
fzf/b2c3d4e5f6a7	fzf	easy	fzf, search, syntax	How do you perform an exact (non-fuzzy) match in fzf?	"Prefix the search term with a single quote, e.g., typing 'error will only match lines containing the exact string ""error""."\n\nRemember: 'exact, ^start, end$, !exclude, | or. Space = AND. Compose: ^src !test .py$	training/library/topics/fzf/primer.md
fzf/c3d4e5f6a7b8	fzf	easy	fzf, multi-select	How do you select multiple items in fzf?	Use the --multi (or -m) flag, then press Tab to select/deselect individual items before pressing Enter.\n\nExample: git log --oneline | fzf -m | cut -d' ' -f1 — pick commits with Tab, output SHAs.	training/library/topics/fzf/primer.md
fzf/d4e5f6a7b8c9	fzf	medium	fzf, preview	How do you show a live preview of the selected item in fzf?	Use the --preview flag with a command, e.g., fzf --preview 'bat --color=always {}'. The {} placeholder is replaced by the currently highlighted line.\n\nExample: fzf --preview 'bat --color=always {}' shows syntax-highlighted content live as you navigate.	training/library/topics/fzf/primer.md
fzf/e5f6a7b8c9d0	fzf	medium	fzf, shell, integration	What three default keybindings does fzf provide after shell integration?	Ctrl-R for fuzzy command history search, Ctrl-T for fuzzy file path insertion, and Alt-C for fuzzy directory navigation (cd into selection).\n\nRemember: R=Recall history, T=Take file, C=Change directory. Three shell-transforming keybindings.	training/library/topics/fzf/primer.md
fzf/f6a7b8c9d0e1	fzf	medium	fzf, environment	What does the FZF_DEFAULT_COMMAND environment variable control?	It sets the command used to generate the input list when fzf is invoked without stdin. For example, setting it to 'fd --type f' uses fd instead of the default find.\n\nExample: export FZF_DEFAULT_COMMAND='fd --type f --hidden' — uses fd instead of find. Faster, gitignore-aware.	training/library/topics/fzf/primer.md
fzf/a7b8c9d0e1f2	fzf	medium	fzf, search, syntax	How do you combine inverse matching with prefix matching in fzf's search syntax?	"Use the ! prefix for inverse and ^ for prefix. For example, !^test excludes lines starting with ""test"". Tokens are space-separated and combined with AND logic."\n\nExample: !^test .py$ = Python files NOT starting with test. Operators compose for precise filtering.	training/library/topics/fzf/primer.md
fzf/b8c9d0e1f2a3	fzf	hard	fzf, keybindings, customization	How do you bind a custom action to a key inside fzf?	Use the --bind flag with the syntax 'key:action', e.g., --bind 'ctrl-y:execute-silent(echo {} | pbcopy)' copies the selection to clipboard on Ctrl-Y.\n\nExample: --bind 'ctrl-y:execute-silent(echo {} | xclip)' copies to clipboard on Ctrl-Y.	training/library/topics/fzf/primer.md
fzf/c9d0e1f2a3b4	fzf	hard	fzf, git, integration	How would you build an interactive git branch checkout using fzf?	Pipe git branch output through fzf and pass the selection to git checkout: git branch -a | fzf | xargs git checkout. Add --preview 'git log --oneline {1}' for commit preview.\n\nGotcha: add --preview 'git log --oneline -20 {1}' to see commits before switching branches.	training/library/topics/fzf/primer.md
fzf/d0e1f2a3b4c5	fzf	hard	fzf, kubectl, integration	How would you interactively switch Kubernetes namespaces using fzf?	kubectl get ns -o name | sed 's|namespace/||' | fzf | xargs kubectl config set-context --current --namespace. This lists namespaces, lets you pick one, and sets it as the current context namespace.	training/library/topics/fzf/primer.md
fzf/e1f2a3b4c5d6	fzf	medium	fzf, environment, defaults	What does the FZF_DEFAULT_OPTS environment variable control, and give a practical example?	FZF_DEFAULT_OPTS sets default flags applied to every fzf invocation. Example: export FZF_DEFAULT_OPTS='--height 40% --reverse --border --preview-window=right:50%' gives a compact, bordered, top-down layout with preview on every use.\n\nRemember: FZF_DEFAULT_COMMAND = what to search. FZF_DEFAULT_OPTS = how it looks. Two separate variables.\n\nGotcha: FZF_DEFAULT_COMMAND only applies when fzf has no stdin. If you pipe into fzf, it uses the pipe.	
fzf/f2a3b4c5d6e7	fzf	easy	fzf, layout, display	What do the --height, --reverse, and --border flags do in fzf?	--height N% renders fzf inline using N% of terminal height instead of fullscreen. --reverse shows the prompt at the top (top-down list). --border draws a box around the fzf window. Combine all three for a compact inline picker.\n\nExample: export FZF_DEFAULT_OPTS='--height 40% --reverse --border' — compact inline layout on every use.	
fzf/a3b4c5d6e7f8	fzf	medium	fzf, shell, trigger	What is the ** trigger in fzf shell integration, and how do you use it?	Typing ** then pressing Tab triggers fzf completion in supported shells. Examples: vim **<Tab> fuzzy-picks a file to edit, cd **<Tab> fuzzy-picks a directory, ssh **<Tab> fuzzy-picks a host from known_hosts.\n\nExample: vim **<Tab> fuzzy-finds files. ssh **<Tab> picks hosts. kill **<Tab> picks processes.	
fzf/b4c5d6e7f8a9	fzf	medium	fzf, multi-select, workflow	How do you select multiple items with Tab and Shift-Tab in fzf, and what flags enable it?	Pass --multi (or -m) to enable multi-select. Tab selects the current item and moves down, Shift-Tab deselects. All selected items are output on Enter, one per line. Combine with xargs for batch operations.	
fzf/c5d6e7f8a9b0	fzf	hard	fzf, preview, sizing	How do you control the preview window position and size in fzf?	Use --preview-window with options: --preview-window=right:60%:wrap puts it on the right at 60% width with line wrapping. Positions: up, down, left, right. Add :hidden to start collapsed (toggle with --bind 'ctrl-/:toggle-preview').\n\nExample: --preview-window=right:60%:wrap:hidden — starts collapsed (toggle ctrl-/). No horizontal scroll.	
fzf/d6e7f8a9b0c1	fzf	hard	fzf, pipe, composition	How do you chain fzf with process substitution to interactively select from multiple sources?	"Use process substitution or concatenation: cat <(git branch) <(git tag) | fzf pipes both branches and tags into one picker. Or: (echo ""option-a""; echo ""option-b""; command-output) | fzf for mixing static and dynamic sources."\n\nExample: (git branch; git tag) | fzf picks from both branches and tags in one menu.	
fzf/3bbbbf0abf1a	fzf	medium	fzf;preview	How do you add a file preview window to fzf?	Use --preview flag: fzf --preview 'cat {}' or --preview 'bat --color=always {}'. The {} placeholder is replaced with the selected item.\n\nExample: fzf --preview 'bat --color=always --line-range :50 {}' — syntax-highlighted preview limited to 50 lines.\n\nGotcha: --preview runs the command for every cursor movement. Heavy commands cause lag.\n\nRemember: {} = current selection. Use {q} for the current query string in --preview.	
fzf/abadb519b5e9	fzf	hard	fzf;integration	Describe how to integrate fzf with git for interactive branch switching.	Use: git branch | fzf | xargs git checkout. Or create an alias: alias gcb='git checkout $(git branch | fzf)'. The pipe feeds branch names to fzf for fuzzy selection.	
fzf/1a4c1e6589c7	fzf	medium	fzf;keybindings	What do the default fzf keybindings Ctrl+T, Ctrl+R, and Alt+C do in bash/zsh?	Ctrl+T: paste selected file path. Ctrl+R: search command history. Alt+C: cd into selected directory. Each invokes fzf with appropriate input.\n\nExample: --bind 'ctrl-y:execute-silent(echo {} | xclip)' copies to clipboard on Ctrl-Y.	
fzf/d88775028775	fzf	medium	fzf;multi	How do you enable multi-select in fzf and what key triggers it?	Use fzf --multi or fzf -m. Press Tab to select/deselect items, then Enter to confirm all selections. Selected items are output one per line.\n\nExample: git log --oneline | fzf -m | cut -d' ' -f1 — pick commits with Tab, output SHAs.	

<!-- wiki:related:start -->
---

## Wiki Navigation

### Related Content

- [Modern CLI Drills](../../../../library/drills/modern_cli_drills.md) (Drill, L0) — fzf
- [Modern CLI Tools](../../../../library/topics/modern-cli/index.md) (Topic Pack, L0) — fzf
- [Skillcheck: Modern CLI Tools](../../../../library/skillchecks/modern-cli-tools.skillcheck.md) (Assessment, L0) — fzf
- [fzf](../../../../library/topics/fzf/index.md) (Topic Pack, L1) — fzf

<!-- wiki:related:end -->
