Where is the .profile file on mac?

On Mac, zsh is the default shell. You can check this by running

echo $SHELL

If so, you can check for ~/.zshrc if not you can create one and add required commands, alias which need to run during the terminal startup.

Then you can run

source ~/.zshrc

This will be executed every time the terminal is opened.


I felt to add something here that ate a lot of my time when I had a similar issue.

Many a times the .profile or the .bash_profile (in case of bash shell) is not present. This is typically when you have freshly installed the OS or when you're on a new machine. This gets confusing as one may think if the installation wasn't correct etc. Nothing to worry about. If you don't find these files then simply create it new using vi or whatever means (GUI) and you're good to go. Having a shell doesn't mean you have these files too and you have to create it yourself if you're the first one to use it.


The file you are looking for depends on your shell, so if you are using bash, which is the default shell on Mac systems, it will be either ~/.bash_profile, or ~/.bashrc depending on whether you are in a login shell or non-login shell respectively.

Mac Terminal runs a login shell every time a new terminal window is open, and it calls .bash_profile, so you should use ~/.bash_profile.