Article Title: Set environment variables in linux. 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. Both source and. can take effect in the modified environment variable configuration file, without the need to log on to the system again.
[Admin @ host1031 ~] $ Soure. bash_profile
[Admin @ host1031 ~] $. Bash_profile
2. Another use of the source command is to read a file in one row and use the content as a shell command for execution. This function is useful in some scenarios, such as compiling source code. & Command indicates that commands connected to it are executed sequentially, but the commands following it can be executed only after the previous commands are successfully executed.
[Admin @ host1031 ~] $ Cat install
Make mrproper &&
Make menuconfig &&
Make dep &&
Make clean &&
Make bzImage &&
[Admin @ host1031 ~] $ Source install
3. A noteworthy question,
Su-user1 # Load Environment Variables
Su user1 # Do not load Environment Variables
4. How to Make environment variables take effect for users logging on to the system, and add the environment variables to be defined in the $ HOME/. bashrc or $ HOME/. bash_profile file.