如何清除 Mac OS X 终端中的先前输出? [英] How can I clear previous output in Terminal in Mac OS X?

查看:23
本文介绍了如何清除 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

Command+K 用于较新的键盘

/usr/bin/osascript -e 'tell application "System Events" to tell process "Terminal" to keystroke "k" using command down'

这篇关于如何清除 Mac OS X 终端中的先前输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆