Environment variable settings

Source: Internet
Author: User
For more information about how to set environment variables-Linux general technology-Linux technology and application, see the following. I have asked questions in the Forum and consulted relevant materials. The following are some details about the environment configuration.
Bytes --------------------------------------------------------------------------------------
Temporary environment variables (disappear after restart) can be viewed with set
Bytes --------------------------------------------------------------------------------------
1. directly use the export command:
Test = abc
Echo $ test
Export test means that the test variable (echo $ test) can still be used in the sub-shell program ). This step cannot be used only in this shell. Enter the sub-shell method: Enter bash directly. Ps will see two bash processes.

Bytes -----------------------------------------------------------------------------------
Permanent environment variables (do not disappear after restart) can be viewed with set
Bytes -----------------------------------------------------------------------------------
1, so that all users can use
Global setting file: ①/etc/profile ②/etc/bashrc
You only need to add the environment variables you set in the preceding two files.

2, only for individual users
User setting file: ③. bash_profile ④. bashrc
These two files have ls-a in each user's directory.
You only need to add the environment variables you set in the preceding two files.

Note: It doesn't matter if the permanent environment variable is added without export. There is no sub-shell.
If there are any of the above shortcomings, we hope you can give them some advice.

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.