I'm on a mac and am about to start developing, did a clean install on my mac just but my question is what is the difference between ~/.bash_profile, ~/.zshrc, ~/.profile, and ~/.bashrc and where can I find the best practices involved with using these files? Also which is being used now on macos because zsh is not the default on terminal? Do I still use bash-profile?


1 Answer 1


You don't really need the "profile" files. They exist mostly for historical reasons. Just put everything you need into the "rc" file.

Which shell, and thus which "rc" file, is used on macOS depends on whether you've set Bash or Zsh as your terminal. I would recommend Zsh, which is (contrary to your statement) now the default shell on macOS.

To figure out which shell you're using right now, type echo $SHELL into the Terminal.

To change your shell to Zsh, type chsh -s /bin/zsh.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.