macOSLinux

Where Does Fish Shell Store History?

Fish shell history lives in a single fish_history file under your data directory. It survives restarts and merges across sessions.

Last updated

Fish keeps one persistent history file shared by every session, unlike shells that write per session on exit. Commands land there as you run them, so a crashed terminal loses almost nothing. The file is plain text with a light markup, readable in any editor.

Concurrent sessions merge rather than overwrite, which mostly works. Simultaneous writes from many sessions can interleave oddly, so expect occasional ordering quirks on busy boxes. The history session name is customizable, but almost everyone uses the default file.

Where Fish stores this, by platform

macOS
~/.local/share/fish/fish_history

Single shared history file across sessions. Edit only with all shells closed. Prefix sensitive commands with a space or use private mode to skip recording.

Linux
~/.local/share/fish/fish_history

Same path and behavior as macOS. Respects XDG data home relocation, so check the env var on customized setups.

Frequently asked questions

How do I wipe my Fish history?

Run the builtin history clear command, or truncate the file with the shell closed. Deleting while sessions run just gets the file rewritten from memory.

How do I keep a secret off the record?

Prefix the command with a space to keep it out, or run in private mode. Both skip the history file for that session only.

Notice an outdated path? Let us know.