標籤: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