I use SSH to login my iMac. And I use SCREEN command all the time. Those configuration files are really confusing.
- ~/.bash_profile. It will be loaded when you use SSH to login.
- ~/.bashrc. It will be loaded when you use SCREEN to enter a new bash.
- ~/.profile. If ~/.bash_profile doesn’t exist, the system will look for .profile file.
So, only .bash_profile and .bashrc are crucial for me. I usually do not edit them. I have a file to store my personal command like alias sl=’screen -ls’. And I add source ~/personal_cmd.sh at the end of .bash_profile and .bashrc to use them anytime and anywhere.