LinuxmacOS

Where Does the sqlite3 Shell Store History?

sqlite3 shell history file in home, and how to relocate or disable it.

Last updated

The sqlite3 command line shell keeps a command history file in your home directory using readline, just like its bigger database cousins. Every statement you type persists there across sessions with no opt in step.

The file's simplicity is the whole story: one flat history with no per database split and no size cap to configure. Database files themselves live wherever you created them, entirely separate from this shell history. Deleting the history file affects recall only, never data.

Where SQLite stores this, by platform

Linux
~/.sqlite_history

Plain readline history shared across every database file you open. Delete it any time for a clean slate. The shell recreates it on next use with no configuration needed.

macOS
~/.sqlite_history

Same path and behavior as Linux for Homebrew and system installs. Database files stay wherever you put them; only shell recall lives here.

Frequently asked questions

how do i clear sqlite3 history

Remove write permission from the history file or point it somewhere disposable. The sqlite3 shell recreates a missing file silently, so deletion is a safe one time wipe with no settings to repair.

does sqlite3 history record sensitive statements

Yes. Commands starting with a space are still recorded by the sqlite3 shell, unlike some other shells. Assume every statement lands in the file and sanitize accordingly before sharing the machine.

Notice an outdated path? Let us know.