Linux Add system Environment variables

Source: Internet
Author: User

when installing and using the software under Linux, it is usually only possible to use the software command in the Software installation directory (except with the Yum command), which is cumbersome and we want to use it globally to add the software installation path to the system environment variable. There are 2 ways to add an environment variable://1, use the Export commandExport path= $PATH:/OPT/SOFTWARE/NODE-V8.9.3-linux-x64/bin/node//export using the export path= $PATH: Path 1: Path 2: path N, $PATH as a system variable, representing the path of all previous settings, if not plus all paths are invalidated. So it must be added. //2. Modify the configuration file/etc/profilevi/etc/Profile added in: Export PATH= $PATH:/opt/software/node-v8.9.3-linux-x64/bin/node//if you modify. Bash_profile in the user's home directory, the added environment variable is only valid for that user, and modifying the/etc/profile takes effect for all users. You can also modify the/etc/rc.local file and the/ROOT/.BASHRC file.
Modifying the configuration file may require restarting the machine to take effect

Linux Add system Environment variables

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.