清除終端機文字的方法 - Linux

By Joe
at 2011-06-24T09:57
at 2011-06-24T09:57
Table of Contents
要清除終端機的文字內容, 據我所知有三種方法:
1. Ctrl + L
缺點: 用組合鍵觸發, 無法寫在script裡面
2. $ clear
缺點: cygwin無內建
3. $ cls
其中cls是alias:
alias cls='echo -e -n "\E[2J"'
缺點: 每使用一次, 游標會往下一行(多按一下Enter的意思)
我想請問的是, 除了上述3個方法, 有沒有其他方式可以清除螢幕文字, 且:
- 並非用組合鍵觸發而能寫在script裡
- 會讓游標跑到畫面最上方(效果如同clear指令)
- 可寫成alias並放入.bashrc中
--
1. Ctrl + L
缺點: 用組合鍵觸發, 無法寫在script裡面
2. $ clear
缺點: cygwin無內建
3. $ cls
其中cls是alias:
alias cls='echo -e -n "\E[2J"'
缺點: 每使用一次, 游標會往下一行(多按一下Enter的意思)
我想請問的是, 除了上述3個方法, 有沒有其他方式可以清除螢幕文字, 且:
- 並非用組合鍵觸發而能寫在script裡
- 會讓游標跑到畫面最上方(效果如同clear指令)
- 可寫成alias並放入.bashrc中
--
Tags:
Linux
All Comments

By Queena
at 2011-06-26T19:20
at 2011-06-26T19:20

By Ursula
at 2011-07-01T00:24
at 2011-07-01T00:24

By Hardy
at 2011-07-01T09:11
at 2011-07-01T09:11

By Madame
at 2011-07-04T04:03
at 2011-07-04T04:03

By Andy
at 2011-07-08T04:13
at 2011-07-08T04:13

By Puput
at 2011-07-12T12:48
at 2011-07-12T12:48

By Robert
at 2011-07-17T08:17
at 2011-07-17T08:17
Related Posts
有模擬負載的軟體嗎?

By Elvira
at 2011-06-24T05:48
at 2011-06-24T05:48
有關製作RPM檔 和checkinstall

By Cara
at 2011-06-23T23:36
at 2011-06-23T23:36
視窗衰退 Linux桌上系統也沒戲唱

By Quanna
at 2011-06-23T20:31
at 2011-06-23T20:31
Linux改灌XP

By Oliver
at 2011-06-23T16:07
at 2011-06-23T16:07
Mint Debian無線網路問題

By Edward Lewis
at 2011-06-23T12:33
at 2011-06-23T12:33