Cleaning up bash customizations

One of the things I found confusing about bash was its startup scripts: there were so many of them. Eventually I snapped and sat down with a terminal and the man pages, and worked out how it actually behaves. Here’s a summary. File Interactive login Interactive non-login Non-interactive Remote shell /etc/profile A /etc/bash.bashrc A† ~/.bashrc B A ~/.bash_profile B2 ~/.bash_login B3 ~/.profile B4 ~/.bash_logout C BASH_ENV A On startup, bash executes any script labeled A in the table above, followed by the first script B it finds.