Score:1

Permanently add to $PATH on MacOS

kr flag

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?

Score:3
uz flag
mgb

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/).

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.