Article Title: Practical Tips: Configure Linux OS environment variables. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. Linux is a multi-userOperating System. Each user logs on to the system and has a dedicated runtime environment. Generally, the default environment of each user is the same. The default environment is actually the definition of a set of environment variables. You can customize your running environment by modifying the corresponding system environment variables.
2. Modify the environment variables in the/etc/profile file. The modified content is effective for all users.
The following operations will be performed in this file.
3. How to add environment variables.
For example, add "NAME = liheng ".
Add the following content at the end of the profile file: export NAME = liheng
The variable value liheng can be enclosed in quotation marks or not, and the effect is the same.
4. The added or modified content in the profile file must be logged out of the system to take effect.
5. How to understand repeated variables.
It is often the definition of the path variable.
For example, in the peofile file, PATH variables are set by default, and PATH variables may be set later, generally, it is added to the last PATH of the profile file ). In the system, the identified PATH =. Everyone must pay attention to it.
6. special characters.
For example, if the profile contains the following content, use the following content to describe the usage of special symbols.
Export A =/q/jing: aaa/cc/ld
Export B =.:/liheng/wang
Export A =/cd/cdr: $
Note the red symbol:
: Represents the meaning of the parallel expression. For example, A variable has multiple values and is separated by A symbol.
. Indicates the current directory you are operating on. For example, the pap command looks for environment variable B.
Type the pap command in/home. The system first searches for the content about B in the/home Directory (that is, the current path), if the content about B is not found in the/liheng/wang directory.
$ Indicates the value before this definition. For example, $ A indicates/q/jing: aaa/cc/ld. That is to say
A =/cd/cdr:/q/jing: aaa/cc/ld
[1] [2] Next page