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
1
|
cat /etc/profile # Global startup file, Debian(Ubuntu) and Redhat(CentOS) distributions
|
User Specific
1
|
cat ~/.bash_profile # RedHat(CentOS) distributions
|
1
|
cat ~/.profile # Debian(Ubuntu) distributions
|
1
|
cat ~/.bash_login # Debian(Ubuntu) and RedHat(CentOS) distributions
|
Non-login Shell Startup Files
The boot files that will be loaded when you enter a bash shell are:
1
|
cat /etc/bashrc # Redhat(CentOS) distributions
|
1
|
cat ~/.bashrc # Debian(Ubuntu) and RedHat(CentOS) distributions
|
References
6 Bash Features,
6.2 Bash Startup Files
Buy me a coffee