如何在Mac OS X的终端中清除以前的输出? [英] How to clear previous output in Terminal in Mac OS X?
本文介绍了如何在Mac OS X的终端中清除以前的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道clear
命令会清除"当前屏幕,但这只是通过打印许多换行符来完成的-清除的内容会向上滚动.
I know the clear
command that 'clears' the current screen, but it does this just by printing lots of newlines - the cleared contents just get scrolled up.
有没有一种方法可以完全清除终端上的所有先前输出,以便即使向上滚动也无法到达?
Is there a way to completely wipe all previous output from the terminal so that I can't reach it even by scrolling up?
推荐答案
要手动清除终端,请执行以下操作:
⌘ + K
命令 + K (用于较新的键盘)
Command+K for newer keyboards
/usr/bin/osascript -e 'tell application "System Events" to tell process "Terminal" to keystroke "k" using command down'
这篇关于如何在Mac OS X的终端中清除以前的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文