Adding Linux system environment variables

The use of source code in Linux to install the software, they usually only be used in the software installation directory of the software command (except use the command yum install), this is too much trouble, we hope global use, can be added to the system software installation path environment variable in. 
There are two ways to add environment variables: 

// 1, use the export command 
export PATH = $ PATH: /opt/software/node-v8.9.3-linux-x64/bin/node 

// export use to export PATH = $ PATH : path 1: path 2: path n; $ pATH variable system, all paths previously set, if not all the previous paths are unavailable. It must be added. 

// 2, modify the configuration file / etc / Profile 
VI / etc / Profile 
inside added: Export the PATH = $ the PATH: /opt/software/node-v8.9.3-linux-x64/bin/node 

// If a user is to modify .bash_profile in your home directory, add the user's environment variables are only valid, modify / etc / profile to take effect for all users. You can also modify the /etc/rc.local file and /root/.bashrc file. 
// execute source / etc / profile or source After modifying the configuration files to make the configuration file to take effect /root/.bashrc

Guess you like

Origin www.cnblogs.com/yjybupt/p/10994646.html