32. Bash Shell - Startup Files
Contents
Bash’s startup configuration file can help us pre-load some other script files as well as preset general and necessary variables.
Bash provides two types of startup files, one that is loaded on login and the other that is loaded on non-login.
Login Shell Startup Files
The startup files that will be loaded at login are:
Global
|
|

Prints a partial content of the /etc/profile on CentOS 7 distribution

Prints a partial content of the /etc/profile on Ubuntu 18 distribution
User Specific
|
|

Prints the content of the ~/.bash_profile on CentOS 7 distribution
|
|

Prints the content of the ~/.profile on Ubuntu 18 distribution
|
|
Non-login Shell Startup Files
The boot files that will be loaded when you enter a bash shell are:
|
|

Prints a partial content of the /etc/bashrc on CentOS 7 distribution
|
|

Prints the content of the ~/.bashrc on CentOS 7 distribution

Prints a partial content of the ~/.bashrc on Ubuntu 18 distribution
References 6 Bash Features, 6.2 Bash Startup Files
Author Dong Chen
LastMod Tue Mar 5 2019