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
Table of contents 1. Aggregate Query 1. COUNT fun...
Index definition: It is a separate database struc...
Navicat reports errors 10060 and 1045 when connec...
Table of contents Preface sql_mode explained The ...
In HTML, the <img> tag is used to define an...
1. Regular expression matching ~ for case-sensiti...
Now many people are joining the ranks of website ...
This article example shares the specific code of ...
I have installed various images under virtual mac...
You may sometimes need to create or delete symbol...
1. Understand the WEB Web pages are mainly compos...
Preface This article uses the new features of MyS...
Preface I believe that everyone has had experienc...
When we are writing a page, we often encounter a ...
Table of contents Optimizing sorting queries Avoi...