Bash File execution sequence

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!

Introduction

.bash_profile, .bash_login, .bashrc, and .profile all do pretty much the same thing: set up and define functions, variables, and the sorts.

The main difference is that .bashrc is called at the opening of a non-login but interactive window, and .bash_profile and the others are called for a login shell. Many people have their .bash_profile or similar call .bashrc anyway.

Remarks

Other files of note are:

  • /etc/profile, for system-wide (not user specific) initialization code.

  • .bash_logout, triggered when logging out (think cleanup stuff)

  • .inputrc, similar to .bashrc but for readline.



Got any Bash Question?