English 中文(简体)
为真正的[闭门]设置一个终端屏幕
原标题:Clear a terminal screen for real [closed]

使用<代码>clear 终端的指挥只使用户对屏幕的思考经过了清扫......当你利用摩擦时,他们仍然能够看到以前的指挥部的产出。 如果你在海啸中投下案文,那就使生活困难。

互联网上可以找到的各种解决办法(例如替罪羊法典等)只是明确指挥已经作出的改动。

因此,你如何真实地清清醒了位于欧罗敦的终端内容?

最佳回答

利用以下指挥系统进行明确的筛选,而不是仅仅增加新线......

printf "33c"

是的,在印巴什上打上印本。

也许,你们会想界定一个细节......

alias cls= printf "33c" 

Explanation

33 == x1B == 27 == ESC

因此,这成为<代码><ESC>c,即VT100号用于重新设定终点站的逃跑代码。 Here是关于终端越狱守则的更多信息。

Edit

这里还有其他几种方式......

printf "ec" #e is ESC in bash
echo -en "ec" #thanks @Jonathon Reinhart.
# -e    Enable interpretation of of backslash escapes
# -n    Do not output a new line

KDE

以上所述并不涉及“Konsole”组织,但希望! 利用下列指挥系统清除屏幕和反馈缓冲......

clear && echo -en "e[3J"

Or perhaps use the following alias on KDE...

alias cls= clear && echo -en "e[3J" 

I got the scroll-back clearing command from here.

问题回答

Try reset. It clears up the terminal screen but the previous commands can be accessed through arrow or whichever key binding you have.

tput reset

那样做!

  1. 清洗可见的屏幕

     clear 
    
  2. 2. 清洁筛查和明确的缓冲

     clear && clear 
    
  3. 2. 清洁和1个拖延

     reset
    
  4. 1. 毫不拖延地清理

     tput reset
    

我赞成人类友好的指挥:

reset

Tested on xterm and VT100. It also helps after an abnormal program termination. Keeps the command buffer, so up-arrow will cycle through previous commands.

我知道使用印刷新线路的解决办法没有得到很多支持,但如果所有其他失败,为什么不支持? 特别是在有人可能看到屏幕,但又无法进行关键博客的环境中工作。 其中一个潜在解决办法是:

alias c="printf  
%.0s  {1..50}"

然后,将屏幕目前的内容(或将其藏匿起来)改为“密码”在终端上。

以下链接将解释如何使这几条内容永久化,以便你不必继续打字。

https://askubuntu.com/questions/17536/how-i-create-a- permanent-bash-alias

这些步骤是这方面的详细步骤。

  1. vim ~/.bashrc or gedit ~/.bashrc or what ever text editor you like
  2. put alias cls= printf "33c" at the bottom of the file
  3. save and exit
  4. . ~/.bashrc (and yes there should be a space between . and ~)
  5. now check to see if everything worked!

我不相信这一信息刚刚通过。

仅添加<代码>tmux 滚动缓冲并不明确clear ,resetf。 页: 1 见

echo -e "e[3J"

这一工作在六氯环己烷中进行。





相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签