Load .bash_profile for every terminal

The files executed at the start may be several, usually ~/.bashrc for interactive, non-login shells. The kind I assume you are using.

If so, create an ~/.bashrc file and source ~/.bash_profile in it:

if [ -f ~/.bash_profile ]; then
    . ~/.bash_profile
fi

This web site has a lot of information about this.

Study this image, as it is a condensed guide

If you do need to find out exactly which file is being executed, take a look at this web page. It has a lot of specific tests to find out what file is setting what.

Specific for Mac-OS (which is an exception and loads ~/.bash_profile) do as is recomended in the site linked in this answer AFTER you confirm that your bash is doing as explained there.


If you use zsh , you can add:

source ~/.bash_profile

at the end of .zshrc file at the following path: /Users/YOUR USER NAME/.zshrc , then restart your Terminal/iTerm2 app.

Note that this file is hidden. You can press CMD + SHIFT + . in Finder to see it, Or just open it in default text editor with the following command from terminal:
open ~/.zshrc

Tags:

Unix

Macos

Bash