/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
Main Menu
- Home
- Kubernetes
- Containerization Stack (DevOps)
- Oracle Cloud Native Environment (OCNE)
- Linux
- Linux "FIND" Command related Articles
- Linux "YUM" Command related Articles
- Linux "PS" Command related Articles
- "AWK" Command related Articles
- Linux "RPM" Command related Articles
- "PING" Command related Articles
- "NTP" related Articles
- Linux Network related Articles and Commands
- Linux Security related Articles
- Linux Troubleshooting Articles
- Linux FILESYSTEM related Articles
- Linux INFINIBAND Network related Articles
- Linux "MOUNT" Command related Articles
- Linux Shell Script Articles
- "BIOS" related Linux Articles
- "NFS" related Articles
- "GREP" Commands related Articles
- Linux "CPU" & "Memory" related Articles
- "SED" Command related Articles
- "SYSTEMCTL" Commands related Articles
- Logical Volumes related Articles
- "TCPDUMPS" related Articles
- GitHub Repositories (tarbots)
- About tarbots
Search
LINUX: /etc/environment Global System Level Environment Variable File (How To)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment