linux命令別名(linux command alias)

來源:互聯網
上載者:User
1、需要列出目錄檔案的詳細資料、檔案大小、並且按時間排序。

        使用 ls –hlt
        設定 alias ll=’ ls –hlt’、以後只用命令 ll 就可以達到 ls –hlt;

2、我們會經常查看某一個連接埠的佔用情況

        使用 watch -n1 “netstat -an | grep 1521″

        設定 alias ora=’ watch -n 1 “netstat -an | grep 1521″’、以後就可以使用 ora來操作了

3、如果經常要進入一個很深的目錄

        如:cd /home/chengdong/info/deploy/app/logs
        設定 alias logs=’ cd /home/chengdong/info/deploy/app/logs’、執行logs 就可以直接進入目錄

設定方法:

linux命令別名在那個檔案中設定呢?
        希望某個使用者具有這個命令,那麼就將別名添加到此使用者目錄下的.bash_profile檔案。
        所有的使用者都可以使用此命令、那麼就要做全域的設定,修改/etc/bashrc 檔案。

 

http://chengdong.info/linux_command_alias.html

相關文章

聯繫我們

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