我使用過的Linux命令之clear - 清除終端螢幕,不是cls

來源:互聯網
上載者:User

標籤:style   blog   http   ar   os   使用   sp   檔案   on   

 

原文連結:http://codingstandards.iteye.com/blog/804213

用途說明

clear命令是用來清除終端螢幕的(clear the terminal screen),使用過DOS或者Windows的cmd的人知道有個cls命令,可以用來清除螢幕,但Linux底下沒有這個命令,我們可以通過使用別名的方式來使Linux系統也具有這個cls命令。另外,按Ctrl+L也可以達到同樣的效果,當我們使用vi/vim編輯檔案時,如果發現螢幕顯示有些混亂,也可以按Ctrl+L來使螢幕顯示恢複正常。

常用參數

無。

如果想使輸入cls也可以清屏,在/etc/profile的末尾添加一行:

alias cls=clear

儲存之後重新登入就可以輸入cls達到clear命令的效果了。

當然更快捷的方式是按住Ctrl鍵不放,然後再按L了。

使用樣本樣本一 使用clear命令清除螢幕

[[email protected] ~]# 
[[email protected] ~]# 
[[email protected] ~]# 
[[email protected] ~]# 
[[email protected] ~]# clear 






[[email protected] ~]#

 

樣本二 使用Ctrl+L清除螢幕

[[email protected] ~]# 
[[email protected] ~]# 
[[email protected] ~]# 
[[email protected] ~]# 
[[email protected]web ~]# Ctrl+L 






[[email protected] ~]#

樣本二 建立別名使cls也可以清除螢幕

[[email protected] ~]# cls 
-bash: cls: command not found
[[email protected] ~]# alias cls=clear 
[[email protected] ~]# cls 

 

我使用過的Linux命令之clear - 清除終端螢幕,不是cls

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.