On Ubuntu, I used the Android adb tool to find that the environment variable has a problem. I checked the configuration of the environment variable in Linux on the Internet and learned about the configuration file of the environment variable, here, the files that can be configured with environment variables are as follows: 1. /etc/profile: Global first, applicable to all shells. The first file used to configure user preferences in the operating system during logon, this file sets the environment information for each user in the system. When the user logs on for the first time, this file is executed to set the shell.
On Ubuntu, I used the Android adb tool to find that the environment variable has a problem. I checked the configuration of the environment variable in Linux on the Internet and learned about the configuration file of the environment variable, here, we will talk about the files that can configure environment variables:
1. /etc/profile: Global first, applicable to all shells. The first file used to configure user preferences in the operating system during logon, this file sets the environment information for each user in the system. When the user logs on for the first time, this file is executed to set the shell. You can configure the environment variable here.
2./etc/environment: the second file used by the operating system during logon. The system configures the file system environment before reading your own profile. I usually set some global variables here. ubuntu's default PATH is in this file, and I will put the adb PATH here. (PS: the above two changes need to be restarted)
3 .~ /. Bash_profile: The third file used for logon is. profile file. Each user can use this file to input shell information dedicated to their own use. When a user logs on, this file is only executed once! By default, it sets some environments to change the game volume and execute the user's. bashrc file. /Etc/bashrc: execute this file for every user running bash shell. When bash shell is opened, the file is read.
4 .~ /. Bashrc: This file contains bash information dedicated to your bash shell. This file is read when you log on and every time you open a new shell.
Common commands:
Echo: echo $ PATH can be used to display environment variables
Export: Set Some environment variables export PATH = "$ PATH:/my_new_path"
Env: Display All environment variables
Set: display all locally defined Shell Variables
Unset: Clear environment variable unset $ PATH
Readonly: readonly PATH