Adding home-brew to PATH

artison66 picture artison66 · Feb 28, 2016 · Viewed 62.1k times · Source

I just installed Home-brew and now I'm trying to insert the home-brew directory at the top of my path environment variable by typing in two commands inside my terminal. My questions are these:

What is a path environment variable?

Are the two codes provided me correct?

echo "export Path=/usr/local/bin:$PATH" >> ~/.bash_profile && source  ~/.bash_profile

After this I am to type in brew doctor. Nothing is happening as far as I can see. Can anyone offer me some advice or direction?

Answer

Lucas Tettamanti picture Lucas Tettamanti · Mar 7, 2021

I installed brew in my new Mac M1 and ask me to put /opt/homebrew/bin in the path, so the right command for this case is:

echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.bash_profile && source ~/.bash_profile