WindowsmacOSLinux

Where Does fzf Store Search History?

fzf keeps no history by default; --history points it at a file. Enabling history, the options file and shell integration notes.

Last updated

Out of the box fzf remembers nothing. Search history exists only when you pass --history with a file path, which fzf then loads and updates on completion. Ctrl-N and Ctrl-P automatically rebind to history navigation once it's on, capped by --history-size.

The community convention is ~/.fzf-history, but any path works: point each integration at its own file to keep histories separate. Default flags belong in FZF_DEFAULT_OPTS or a file via FZF_DEFAULT_OPTS_FILE (often ~/.fzfrc). Shell Ctrl-R integrations reuse your shell's own history file, not fzf's.

Where Fzf stores this, by platform

Windows
%USERPROFILE%\.fzf-history

Only used when --history points here; fzf creates and truncates it automatically. Keep one file per workflow (files vs git log) to stop histories polluting each other.

macOS
~/.fzf-history

Same opt-in role. Store shared flags in FZF_DEFAULT_OPTS_FILE instead of repeating --history everywhere. Shell key bindings read shell history, unaffected by this file.

Linux
~/.fzf-history

Mirrors macOS exactly. History files are plain text, one entry per line, capped at --history-size lines (1000 default) with oldest dropped first.

Frequently asked questions

Why does fzf forget my searches?

You never gave it a history file. Add --history ~/.fzf-history (plus --history-size if 1000 lines isn't right) to the invocation or FZF_DEFAULT_OPTS. Without the flag, every session starts blank by design.

Where do I put permanent fzf options?

In FZF_DEFAULT_OPTS for inline flags, or a file referenced by FZF_DEFAULT_OPTS_FILE for longer setups. Both load on every run. Keep --preview out of the globals: it breaks non-file uses like piping process lists.

Notice an outdated path? Let us know.