Bash File execution sequence .profile vs .bash_profile (and .bash_login)

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

.profile is read by most shells on startup, including bash. However, .bash_profile is used for configurations specific to bash. For general initialization code, put it in .profile. If it's specific to bash, use .bash_profile.

.profile isn't actually designed for bash specifically, .bash_profile is though instead. (.profile is for Bourne and other similar shells, which bash is based off) Bash will fall back to .profile if .bash_profile isn't found.

.bash_login is a fallback for .bash_profile, if it isn't found. Generally best to use .bash_profile or .profile instead.



Got any Bash Question?