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

source /etc/environment

4 comments:

fgysin said...

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

Anonymous said...

echo $PATH
/root/.bash_profile
/root/.bashrc
source .bash_profile
~USERNAME/.bash_profile
/etc/skel/.bash_profile

Naresh Surampudi said...

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

...
JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
...
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.

Mary Brown said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training India . Nowadays Java has tons of job opportunities on various vertical industry.