Shell基礎-環境變數設定檔,

來源:互聯網
上載者:User

Shell基礎-環境變數設定檔,

Shell基礎-環境變數設定檔

 

source 設定檔 或者 . 設定檔:

把環境變數寫入設定檔後,需要使用者重新登陸才會生效,而是用source命令,則能直接生效

主要的設定檔:

         /etc/profile

         /etc/profile.d/*.sh

         ~/.bash_profile

         ~/.bashrc

         /etc/bashrc

         其中/etc/profile /etc/profile.d/*.sh /etc/bashrc 對所有使用者都生效

         ~/.bash_profile  ~/.bashrc只對目前使用者生效

環境變數設定檔調用順序

 #無法顯示圖片,需要的可以私聊

設定檔 /etc/profile 的作用

USER變數

LOGNAME變數

MAIL變數

PATA變數

HOSTNAME變數

HISTSIZE變數

umask

調用/etc/profile.d/*.sh檔案

 

設定檔 ~/.bash_profile的作用

調用~/.bashrc檔案

在PATH變數後面加入“:$HOME/bin”這個目錄

 

Shell登入資訊

本地終端歡迎資訊:/etc/issue

 

#無法顯示圖片,需要的可以私聊

 

遠程登入資訊檔案(以上轉義符不能用於此檔案夾,只能寫純文字資訊):/etc/issue.net

         是否顯示此歡迎資訊,由ssh的設定檔/etc/ssh/sshd_config決定,加入“Banner /etc/issue.net”行才能顯示,還要重啟SSH服務

 

對遠程和本地都生效的登入後的歡迎資訊:/etc/motd

 

聯繫我們

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