小编nac*_*dus的帖子

仅清除最后一条命令的终端输出

与其滚动数百行输出以查看先前的命令历史记录,还可以清除最后一条命令的输出吗?例如,在执行之后ls,清除它的输出,因为你不再需要它了。

编辑:

这不是您通常的操作clearctrl+L操作。这个想法是通过历史记录向后滚动以查找上一个命令的输出,但除非我真的想要,否则不必滚动超过ls, or cat, 或sudo apt-get install输出的负载。它可能看起来像这样:

cat fileIWantToRemember
ls directoryIWantToForget
# some command that wipes the output of ls
# scroll back to see the output of cat immediately
Run Code Online (Sandbox Code Playgroud)

linux terminal bash ubuntu

20
推荐指数
1
解决办法
1万
查看次数

标签 统计

bash ×1

linux ×1

terminal ×1

ubuntu ×1