After you log on to the system, bash starts and reads a series of configuration scripts called Startup Files. These scripts define the default environment shared by all users
Introduction
After you log on to the system, bash starts and reads a series of configuration scripts called Startup Files. These scripts define the default environment shared by all users.
Next, bash will read more startup files stored in the main directory to define the personal environment.
The information about these steps is determined by the shell session type started.
========================================================== ======
Session Type: login and non-login
There are two types of shell sessions: login shell session and non-login shell session.
The login shell session prompts the user to enter the user name and password, such as the Virtual Console Session. The terminal we start in the GUI is a typical non-login shell.
Startup file read by login shell session
/Etc/profile |
Global configuration scripts for all users |
~ /. Bash_profile |
User's personal startup file. Allows you to scale or override settings in the global configuration script. |
~ /. Bash_login |
|
~ /. Profile |
|
Startup file read by non-login shell session
/Etc/bash. bashrc |
Global configuration scripts for all users |
~ /. Bashrc |
The user's personal startup file. Allows you to scale or override settings in the global configuration script. |
Description
In addition to reading the preceding startup file, the non-login shell session inherits the environment of the parent process. its parent process is usually a login shell session.