.bashrcと.bash_profileの違い †Linuxの標準シェルとして採用されているbash(Bourne Again Shell)ですが設定ファイルとして以下の2つがあります。
この2つの違い(使い方)について、以下に記述します。 関連記事 †.bashrcと.bash_profileの説明 †
実験 †CentOSでは以下のように.bashrc, .bash_profileが記述されています。 .bashrc †# .bashrc # Source global definitions # User specific aliases and functions .bash_profile †# .bash_profile # Get the aliases and functions # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH 以下のように編集してテストしてみます。 .bashrc編集版 †読み込まれた時、Read .bashrcと表示します。 # .bashrc # Source global definitions # User specific aliases and functions .bash_profile編集版 †読み込まれた時、Read .bash_profileと表示します。 # .bash_profile # Get the aliases and functions # User specific environment and startup programs PATH=$PATH:$HOME/bin
|