November 11, 2016

The method of configuring linux environment variables

□ Right now configuration
○ Entering the command at a shell : export [Environment variable]="[Value]"
○ Configured environment variables is removed when the shell is exited

□ Configuring environment variables sustainable
○ appling to login shell
- Select one file among /etc/profile, ~/.bash_profile, /etc/bashrc, ~/.bashrc and append the command to the last line of the file
- Enter the command : export [Environment variable]="[Value]"
○ Appling to non login shell
- Select one file among /etc/bashrc, ~/.bashrc and append the command to the last line of the file
- Enter the command : export [Environment variable]="[Value]"


P.S.
- The command changing the PATH : export PATH="[Extra path]:$PATH"
- The export command applies to local environment variable and global environment variable.