linux modify the current user environment variables permanent

eg:

MONGO_HOME=/opt/mongodb3.2/

export PATH=$PATH:$MONGO_HOME/bin/

problem:

Increase in variable .bash_profile file in the user directory [for a single user to take effect (permanent)]

Increase in the .bash_profile file in the user directory variable, the amount of change will only current user, just to make changes take effect immediately, we need to execute the following code # source .bash_profile in the user directory

But we found after performing only take effect in the current session.

Solution:

The user's own environment variables to take effect and then write in .bashrc. .Bashrc

This time for a single user was able to achieve permanent.

Guess you like

Origin www.cnblogs.com/any-way/p/11597107.html