Concepts about Linux (Environment) variables-system preset variables and User-Defined variables
Source: Internet
Author: User
Some concepts about Linux (Environment) variables-system preset variables and User-Defined variables-general Linux technology-Linux programming and kernel information. For more information, see the following. Author: wanglilife
I have never understood how to add or modify (Environment) variables in Linux. This problem is currently mainly encountered during software installation (or similar problems may occur in system management in the future, to run the program, you must set the relevant (Environment) variables after the installation is complete to run the program correctly. Maybe this is different from the installation of the program in Windows. The following describes the concepts and possible instances.
1. The default upper-case words of system preset variables are generally used, and the user's self-set variables should not be capitalized to distinguish them from system preset variables;
2. Use the env command to view all preset variables of the system, and use the set command to view all current variables (including preset variables and self-set variables );
3. Use echo $ variable to view the variable value;
4. Set the variable accumulation to expand the value of the previously set variable, such as PATH = "$ PATH:/home/Hu HU" or PATH = "$ PATH ": /home/zhuhu can add values to the PATH variable;
5. To allow the set variable to run in multiple copies of the same program (parent-child relationship, similar to parent and child processes in the operating system), use export to set this variable, for example, export PATH or export PATH = "$ PATH:/home/mozhu" can make the set PATH variable take effect in multiple copies of the program;
6. In order to make the variable settings take effect, sometimes we have to log out before login, but you can use the source variable color to set the file name to make the variable's setting take effect immediately, instead of learning the previous logout and login.
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