2017年9月18日 星期一

[BASH]如何初始化BASH環境設定?

如何初始化BASH環境設定?

BASH登入流程如下,使用者可透過更改下檔案來初始化環境設定
=>使用者登入BASH -> 執行 /etc/profile ->執行 ~/.bash_profile, ~/.bash_login, ~/.profile


/etc/profile: 全體環境變數,只有root能修改
~/.bash_profile, ~/.bash_login, ~/.profile都是個人設定檔只有login shell會讀)
~/.bashrc: 屬於個人設定檔,non login shell, bash 只會讀此檔案(~/.bashrc 會呼叫 /etc/bashrc 及 /etc/profile.d/*.sh,另外須注意/etc/profile先執行然後才是~/.bashrc )。



沒有留言:

張貼留言