Source: https://stackoverflow.com/questions/415403/whats-the-difference-between-bashrc-bash-profile-and-environmentAnything to add? Let's talk @kgoutsos. Share this page on Twitter, Facebook, LinkedIn or use the permalink.
The difference between .bashrc, .bash_profile, .profile etc.
System-wide initialisation file, executed when an login shell starts.
Personal initialisation file, executed when an login shell starts.
Personal startup file, executed when an interactive shell starts and is not a login shell.
Personal cleanup file, executed when a login shell exits.
Quoting from the file itself:
Executed by the command interpreter for login shells. This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login exists.
For different shells, the bash-specific filenames are modified accordingly, e.g.
~/ash_profile in ash shell
To avoid duplicate commands and get around shell-specific differences, users often call one file from another, especially in the case of