alias命令在linux/unix下的使用

來源:互聯網
上載者:User

Linux命令:alias

功能說明:設定指令的別名。
語  法:alias[別名]=[指令名稱]
補充說明:使用者可利用alias,自定指令的別名。若僅輸入alias,則可列出目前所有的別名設定。 
alias的效力僅及於該次登入的操作。若要每次登入是即自動設好別名,可在.profile
或.cshrc中設定指令的別名。
參  數:若不加任何參數,則列出目前所有的別名設定。

例 子: 設定別名 alias ll ='ls -l'
驅動模組設定,在/etc/modprobe.conf(modules.conf)
alias eth0 tg3
alias eth1 bcm5700
alias eth2 off 刪掉eth2模組
使用舉例。
環境red hat linux 9.0
編輯使用者的環境變數檔案.bash_profile
添加如下的一行
alias sc="source ~/.bash_profile"
alias p="ps -u $USER"
儲存後退出
然後執行source .bash_profile,重新載入環境變數檔案.
這時你就可以在目前使用者下使用sc這個別名作為命令,它就等效你執行source ~/.bash_profile命令。
如果在unix下面,添加的辦法一樣,只是文法稍微有點變化。
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.