如何清除 MongoDB 中的控制台
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13327218/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to clear console in MongoDB
提问by Salvador Dali
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?
在使用 Mongodb 控制台或 shell 时,有时我的屏幕上堆满了许多我不需要的先前输出。那么,MongoDB 中是否有清除控制台的功能?
Something like an analog of clear in MatLab.
类似于 MatLab 中 clear 的模拟。
I have tried clc
, clear
but with no success.
我试过clc
,clear
但没有成功。
回答by Salvador Dali
回答by Stennie
If you are using MongoDB 2.0 or higher, the mongo
shell supports both:
如果您使用的是 MongoDB 2.0 或更高版本,mongo
shell 支持两者:
cls
commandCtrl+l
(clear screen)
cls
命令Ctrl+l
(清屏)
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:
在 OS X Terminal.app 中,您还可以执行以下操作:
Command+K
(clear scrollback)
Command+K
(清除回滚)
Clearing the screen and/or scrollback buffer are independent of the history, so you can still cursor up/down to run previous commands.
清除屏幕和/或回滚缓冲区与历史记录无关,因此您仍然可以向上/向下光标以运行以前的命令。