[Ubuntu] Environment variable configuration

First of all, you need to know several files related to environment variables

  • /etc/profile - This file sets the environment information for each user of the system. When the user logs in for the first time, this file is executed. And collect the shell settings from the configuration file in the /etc/profile.d directory;

  • /etc/environment - The second file used by the operating system when logging in, the system sets the environment variables of the environment file before reading your own profile;

  • /etc/bashrc - Executes this file for every user running the bash shell. This file is read when the bash shell is opened;

  • ~/.profile - Each user can use this file to enter shell information dedicated to their own use. When the user logs in, this file is executed only once! By default, it sets some environment variables and executes the user's .bashrc file;

  • ~/.bashrc - this file contains bash information specific to your bash shell, which is read when logging in and every time a new shell is opened;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326357269&siteId=291194637