How do I clear the command history in the mongo shell
MongoDB terminal history is stored inside the ~/.dbshell
file. Just empty the .dbshell
file
$ > ~/.dbshell
Versions of Windows mongo.exe earlier than 2.2.0 will save the .dbshell file in the mongo.exe working directory.
You can clear contents on the shell by Ctrl + L
There should be a file called .dbshell in your home folder. Just delete it.