Shell is a program written in C language, which is a bridge for users to use Linux. Shell is both a command language and a programming language. There are several shell versions, bash is the default: sh (full name Bourne Shell): It is the shell originally used by UNIX and can be used on every UNIX. Let's look at the configuration of Bash environment variables in Linux In Linux, we usually configure environment variable information into different files. Commonly used configuration files are:
The above configurations are mainly different between interactive login Shell and interactive non-login Shell, and different configurations will be loaded. Interactive Login Shell It is to log in to the Linux system, enter your username and password, or Non-Login Shell After you enter the system, open a terminal and execute Bash. /etc/profile Generally, it is used for system configuration, setting environment information for each user of the system. When a user logs in for the first time, this file is executed and collects shell settings from the configuration files in the Changes to /etc/profile.d/ It can be understood as a part of /etc/bashrc This file is executed for each user who runs the Bash Shell. When the Bash Shell is opened, the file is executed and its configuration is effective for each Bash opened by all users using bash. Once modified, you only need to open a new Bash to take effect without restarting. ~/.bash_profile The file is in the user directory and sets exclusive environment information and startup programs for the current user. The file is executed once when the user logs in and executes the current user's ~/.bashrc Sets exclusive Bash information for the current user. This file is executed every time a new shell is opened. If there are any modifications, there is no need to restart, just open a new Shell terminal. ~/.bash_logout This file is executed every time the current user exits the Bash shell. The above files that require a restart to take effect are temporarily effective through methods such as Summarize This is the end of this article about how to configure Bash environment variables in Linux. For more relevant Linux environment variable configuration content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
>>: jQuery implements article collapse and expansion functions
First, let's take a look at my basic developm...
Written in front When we operate the database in ...
To implement the "Enter != Submit" probl...
I just saw a post titled "Flow Theory and Des...
I believe that students who have learned about th...
CSS naming rules header: header Content: content/c...
The following three methods are commonly used to d...
Table of contents 1. Requirements description 2. ...
If there is a backup, it is very simple. You only...
Preface In general development, images are upload...
HTML page jump: window.open(url, "", &q...
Disable right-click menu <body oncontextmenu=s...
<br />Original text: http://andymao.com/andy...
I started using Linux for development and enterta...
Table of contents What is pre-analysis? The diffe...