Ubuntu Linux System environment variable configuration file:
/etc/profile: The first file that is used when the operating system customizes the user environment at logon, which sets the environment information for each user of the system, which is executed when the user logs on for the first time.
/etc/environment: The second file used by the operating system at logon, the system sets environment variables for environment files before reading your own profile.
~/.profile: The third file that is used to log on is the. profile file, which each user can use to enter shell information that is specific to their own use, which is executed only once when the user logs on. By default, he sets some environment variables, Executes the user's. bashrc file.
/ETC/BASHRC: Executes this file for each user running the bash shell. When the bash shell is opened, the file is read.
~/.BASHRC: This file contains bash information dedicated to your bash shell, which is read when you log in and every time you open a new shell.
Better use go, need to set environment variables
sudo vim/etc/profile
In the previous add
Export Goroot=/usr/lib/go
Export Gopath= $HOME/gocode
Reboot the system to
(If you want to take effect immediately, you can source/etc/profile)
Ubuntu Linux System environment variable configuration file