Relode or Restart environment variables "/etc/environment" without reboot or logoff

source /etc/environment


fgysin said...

This is wrong, /etc/environment is not a script and can not be executed with source.

Anonymous said...

echo $PATH
source .bash_profile

Naresh Surampudi said...

Put the environment variables into the global /etc/environment file:

Execute "source /etc/environment" in every shell where you want the variables to be updated:

$ source /etc/environment
Check that it works:

$ echo $JAVA_HOME
$ /usr/lib/jvm/java-1.5.0-sun
Great, no logout needed.

Anonymous said...

If you want the environment variables to be 'sticky' source command will not soon as you log out, and log back in, they'll be gone. How to make it sticky, without reboot, for root user?