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
Overview Today I will mainly share how to correct...
So after registering a domain name and purchasing...
Redis Introduction Redis is completely open sourc...
1. System environment The system version after yu...
1. MySQL installed via rpm package service mysqld...
Table of contents 1. Browser support 2. export ex...
Official website address: https://www.mysql.com/ ...
Description Solution VMware 15 virtual machine br...
This article shares the installation and configur...
<body> <div id="root"> <...
A common suggestion is to create indexes for WHER...
In the project, you will encounter custom public ...
If you want to exit bash, there are two options: ...
This blog is a work note environment: nginx versi...
1. Windows Server 2019 Installation Install Windo...