how to clear console in mongodb

While using Mongodb console or shell sometimes my screen is cluttered with a lot of previous output which I do not need. So, is there a function to clear console in MongoDb?

Something like analog of clear in matlab. I have tried clc, clear but with no success.


Judging by Jira they have done it: You need to write cls in the shell.

You can also use a hotkey: CTRL + L.

In macOS: Command + K.

Check more hotkeys for the shell here.

If you are using MongoDB 2.0 or higher, the mongo shell supports both:

  • cls command
  • Ctrl+l (clear screen)

Note that both of these clear the screen and put the cursor at the top .. but you can still scrollback to see previous history.

In OS X you can also do:

  • Command+K (clear scrollback)

Clearing the screen and/or scrollback buffer are independent of the history, so you can still cursor up/down to run previous commands.

Need Your Help

Divide a number by 3 without using *, /, +, -, % operators

c math division divide

How would you divide a number by 3 without using *, /, +, -, %, operators?

Android: Toast in a thread

android multithreading android-toast

How can I display Toast messages from a thread?