3

I am trying to add to my $PATH on MacOS (Monterey)

When I use

export PATH=$PATH:~/.composer/vendor/bin

It will add it to $PATH and I can see it when I use

echo $PATH

However when I reboot the computer, that item is removed from $PATH and needs to be added again.

Is there a way to permanently add it to the $PATH?

One thing I have noticed is that there is no ~/.profile file.

Do I need to make one and add something to it?

Lawrence Cooke
  • 167
  • 1
  • 1
  • 7

1 Answers1

4

It depends on the shell you're using. If you use ZSH (the default shell for Catalina and newer systems) you should edit your .zshrc file (see more at https://stackoverflow.com/questions/11530090/adding-a-new-entry-to-the-path-variable-in-zsh).

If you use BASH I would edit both your .bashrc and your .bash_profile files (supplementary information under https://scriptingosx.com/2017/04/about-bash_profile-and-bashrc-on-macos/).

mgb
  • 56
  • 5