How to clear console in MongoDB

前端 未结 2 1290
旧巷少年郎
旧巷少年郎 2020-12-25 09:05

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?

2条回答
  •  时光说笑
    2020-12-25 09:59

    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 Terminal.app 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.

提交回复
热议问题