Docs Menu
Docs Home
/
MongoDB Shell
/ /

View Shell Command History

On this page

  • Steps

The MongoDB Shell saves a history of all commands you've run across sessions. When a new command is issued, it is added to the beginning of the history file.

To view the MongoDB Shell command history, open the following file in a text editor:

Operating System
Path to History File

macOS and Linux

~/.mongodb/mongosh/mongosh_repl_history

Windows

%UserProfile%/.mongodb/mongosh/mongosh_repl_history

Back

View Logs

On this page