How to clear command history in mongodb shell

Is there a command to clear history from the mongo shell?

+7
source share
3 answers

Your home folder must have a .dbshell file. Just delete it.

+23
source

You can clear the contents of the shell with Ctrl + L

+2
source

The MongoDB terminal history is stored inside the ~/.dbshell . Just run the .dbshell file

  $ > ~/.dbshell 

Windows versions of mongo.exe prior to 2.2.0 will save the .dbshell file in the mongo.exe working directory.

0
source

All Articles