Practical Tips: Configure Linux OS environment variables

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.