Main Menu

Search

LINUX: /etc/environment Global System Level Environment Variable File (How To)

/etc/environment file is the Linux System level global environment variable file to set the environment variables.

We can set environment variables such HTTP_PROXY etc. in /etc/environment file by adding line as follows. There is no need to give export word before the environment variables when specifying in /etc/environment file. Each environment variable should be in separate line.

HTTP_PROXY=http://www-proxy.xyz.com:80

After setting the environment variables to pick up the changes the host has to rebooted. If the changes in /etc/environment have to be picked up without reboot following command can be executed.

for env in $( cat /etc/environment ); do export $(echo $env | sed -e 's/"//g'); done

No comments:

Post a Comment