This is what is stated in Bash Reference Manual:
When Bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
It says there that bash will read and execute commands from the first one that exists and is readable.
Could it be that ~/.bash_profile
and ~/.bash_login
didn’t exist before? That’s why the commands in .profile
were executed—because ~/.profile
was the only file that existed.
If either ~/.bash_profile
or ~/.bash_login
exists, ~/.profile
will be ignored.