LoginSignup
1
1

More than 5 years have passed since last update.

RHEL7で環境変数を永続的に設定する

Last updated at Posted at 2018-04-17

RHEL7で環境変数を永続的に設定する

参考:
https://www.kannon.link/fuku/index.php/2016/09/09/01-3/

結論

  • 特定ユーザに環境変数を設定したいのであれば、全ユーザに環境変数を設定したいのであれば、/etc/profile
  • 特定ユーザに環境変数を設定したいのであれば、特定ユーザに環境変数を設定したいのであれば、~/.bash_profile

ということなので、ログイン時のbash設定ファイルの読み込み順序は以下順。
1. /etc/profile
2. ~/.bash_profile

/etc/profile.d/内にある、*.shが自動で呼ばれる。
~/.bash_profileに記述されている内容が、ユーザログイン時に実行される(ユーザ毎に用意)

設定ファイルの内容を反映(または再ログイン)

$ source ~/.bash_profile
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1