1. Environment variable $PATH: Each user can modify their own environment variables as needed to meet their own usage requirements. Common environment variables are as follows: In For example, to view the value of PATH: echo $PATH You can view all the system environment variable settings by using the env or printenv command. The following shows the result of the env command (partial): TERM=xterm SHELL=/bin/bash USER=leo PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games HOME=/home/leo LANGUAGE=zh_CN:zh:en_US:en LOGNAME=leo 2. Modify environment variables: Logged-in users can modify and set environment variables as needed. To modify environment variables in Linux, 2.1 Modify the system configuration file (recommended) By modifying the system configuration file, you can achieve the purpose of Running files can be operated in the same way as source ~/.bash_profile Usually modify For example: PATH=$PATH:$HOME/bin Specific insights are as follows: The code The code Note: The path environment variable is PATH, but add a 2.2 Temporary settings Setting environment variables through variable = $variable: add variable value #method 1export variable = $variable: add variable value #method 2 For example: picture The newly added variable value can be placed at the end of the original variable value (variable: new variable value), at the beginning of the original variable value (new variable value: variable: new variable value), or at the beginning of the original variable value (new variable value: variable: new variable value). 3. Purpose of bash_profileIn .bash_profile, it is often used to configure environment variables and some user-defined aliases, etc. SummarizeThis is the end of this article about the detailed explanation of the .bash_profile file in the Linux system. For more relevant Linux .bash_profile file content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of CSS3 practical methods (recommended)
>>: Detailed explanation of Vue's keyboard events
CSS: Copy code The code is as follows: *{margin:0;...
Table of contents Preface Query usage scenario ca...
This article provides some commonly used rewrite ...
Table of contents What is a slot Understanding of...
Web design and development is hard work, so don...
Table of contents 1. Check the status of the serv...
CSS3 implements a flippable hover effect. The spe...
This article shares the installation tutorial of ...
1. Download the MySQL installation package First ...
I believe everyone is familiar with database inde...
JSON data is displayed and formatted on the HTML ...
Recently, when I was modifying the intranet porta...
This article mainly introduces how to implement l...
1 Effect Demo address: https://www.albertyy.com/2...
Part 1 HTML <html> -- start tag <head>...