What is the right way to set $PATH variable in zshrc












1














When I first install zsh(oh-my-zsh), the ~/.zshrc file has the following lines by default -



# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH


What is the author trying to say here? Bash is the default shell on MAC and Linux, so yes, we are coming from BASH. So is he trying to say that, just uncomment the second line? Or he is saying to do some other setup that I should look for on the internet?



Anyone who is well versed is welcome to explain how should I configure the $PATH the right way, when I first install zsh on my mackbook (macOS-11).










share|improve this question


















  • 1




    Maybe my answer to another question might give you some further information on how to set your PATH variable effectively.
    – mpy
    Feb 22 at 19:28
















1














When I first install zsh(oh-my-zsh), the ~/.zshrc file has the following lines by default -



# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH


What is the author trying to say here? Bash is the default shell on MAC and Linux, so yes, we are coming from BASH. So is he trying to say that, just uncomment the second line? Or he is saying to do some other setup that I should look for on the internet?



Anyone who is well versed is welcome to explain how should I configure the $PATH the right way, when I first install zsh on my mackbook (macOS-11).










share|improve this question


















  • 1




    Maybe my answer to another question might give you some further information on how to set your PATH variable effectively.
    – mpy
    Feb 22 at 19:28














1












1








1







When I first install zsh(oh-my-zsh), the ~/.zshrc file has the following lines by default -



# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH


What is the author trying to say here? Bash is the default shell on MAC and Linux, so yes, we are coming from BASH. So is he trying to say that, just uncomment the second line? Or he is saying to do some other setup that I should look for on the internet?



Anyone who is well versed is welcome to explain how should I configure the $PATH the right way, when I first install zsh on my mackbook (macOS-11).










share|improve this question













When I first install zsh(oh-my-zsh), the ~/.zshrc file has the following lines by default -



# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH


What is the author trying to say here? Bash is the default shell on MAC and Linux, so yes, we are coming from BASH. So is he trying to say that, just uncomment the second line? Or he is saying to do some other setup that I should look for on the internet?



Anyone who is well versed is welcome to explain how should I configure the $PATH the right way, when I first install zsh on my mackbook (macOS-11).







bash shell zsh .bash-profile oh-my-zsh






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 22 at 18:10









Akshayraj Kore

11615




11615








  • 1




    Maybe my answer to another question might give you some further information on how to set your PATH variable effectively.
    – mpy
    Feb 22 at 19:28














  • 1




    Maybe my answer to another question might give you some further information on how to set your PATH variable effectively.
    – mpy
    Feb 22 at 19:28








1




1




Maybe my answer to another question might give you some further information on how to set your PATH variable effectively.
– mpy
Feb 22 at 19:28




Maybe my answer to another question might give you some further information on how to set your PATH variable effectively.
– mpy
Feb 22 at 19:28










1 Answer
1






active

oldest

votes


















0














There is nothing wrong in setting your path by uncommenting the second line. However, having that enabled by default in oh-my-zsh, the very least will be annoying. Why? You could have set up your own PATH and then this will brake functionality you've explicitly set up.



Now what the author is trying to say - bash environments do not have $HOME/bin and /usr/local/bin in their default PATH, however, both places are quite popular for packets(/usr/local/bin is where anything you install lives in UNIX systems like FreeBSD while $HOME/bin is usually for user installed packets that were installed without root privileges).



Lastly, you can set up your PATH the best way that fits your needs. A good way will be to start with examining what's currently in your PATH and adding any extra paths to it as you find fit



export PATH=/some/path:$PATH





share|improve this answer





















  • I will be using brew for installing packages. There are some recommendations out there - on how to setup $PATH variable. Brew creates symlinks when it installs packages. If $PATH is not set right, it can create some headaches when using brew installed packages. What do you think is the best approach from that perspective?
    – Akshayraj Kore
    Feb 22 at 18:32










  • Well, I've used brew with zsh(not oh-my-zsh) and I've had no problems apart from when using packages that already exist in the system(like python for instance). The best approach will be to do whatever brew documentation suggests. If you ever run into issues, you can always modify your PATH to resolve.
    – man0v
    Feb 22 at 18:45











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1297418%2fwhat-is-the-right-way-to-set-path-variable-in-zshrc%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














There is nothing wrong in setting your path by uncommenting the second line. However, having that enabled by default in oh-my-zsh, the very least will be annoying. Why? You could have set up your own PATH and then this will brake functionality you've explicitly set up.



Now what the author is trying to say - bash environments do not have $HOME/bin and /usr/local/bin in their default PATH, however, both places are quite popular for packets(/usr/local/bin is where anything you install lives in UNIX systems like FreeBSD while $HOME/bin is usually for user installed packets that were installed without root privileges).



Lastly, you can set up your PATH the best way that fits your needs. A good way will be to start with examining what's currently in your PATH and adding any extra paths to it as you find fit



export PATH=/some/path:$PATH





share|improve this answer





















  • I will be using brew for installing packages. There are some recommendations out there - on how to setup $PATH variable. Brew creates symlinks when it installs packages. If $PATH is not set right, it can create some headaches when using brew installed packages. What do you think is the best approach from that perspective?
    – Akshayraj Kore
    Feb 22 at 18:32










  • Well, I've used brew with zsh(not oh-my-zsh) and I've had no problems apart from when using packages that already exist in the system(like python for instance). The best approach will be to do whatever brew documentation suggests. If you ever run into issues, you can always modify your PATH to resolve.
    – man0v
    Feb 22 at 18:45
















0














There is nothing wrong in setting your path by uncommenting the second line. However, having that enabled by default in oh-my-zsh, the very least will be annoying. Why? You could have set up your own PATH and then this will brake functionality you've explicitly set up.



Now what the author is trying to say - bash environments do not have $HOME/bin and /usr/local/bin in their default PATH, however, both places are quite popular for packets(/usr/local/bin is where anything you install lives in UNIX systems like FreeBSD while $HOME/bin is usually for user installed packets that were installed without root privileges).



Lastly, you can set up your PATH the best way that fits your needs. A good way will be to start with examining what's currently in your PATH and adding any extra paths to it as you find fit



export PATH=/some/path:$PATH





share|improve this answer





















  • I will be using brew for installing packages. There are some recommendations out there - on how to setup $PATH variable. Brew creates symlinks when it installs packages. If $PATH is not set right, it can create some headaches when using brew installed packages. What do you think is the best approach from that perspective?
    – Akshayraj Kore
    Feb 22 at 18:32










  • Well, I've used brew with zsh(not oh-my-zsh) and I've had no problems apart from when using packages that already exist in the system(like python for instance). The best approach will be to do whatever brew documentation suggests. If you ever run into issues, you can always modify your PATH to resolve.
    – man0v
    Feb 22 at 18:45














0












0








0






There is nothing wrong in setting your path by uncommenting the second line. However, having that enabled by default in oh-my-zsh, the very least will be annoying. Why? You could have set up your own PATH and then this will brake functionality you've explicitly set up.



Now what the author is trying to say - bash environments do not have $HOME/bin and /usr/local/bin in their default PATH, however, both places are quite popular for packets(/usr/local/bin is where anything you install lives in UNIX systems like FreeBSD while $HOME/bin is usually for user installed packets that were installed without root privileges).



Lastly, you can set up your PATH the best way that fits your needs. A good way will be to start with examining what's currently in your PATH and adding any extra paths to it as you find fit



export PATH=/some/path:$PATH





share|improve this answer












There is nothing wrong in setting your path by uncommenting the second line. However, having that enabled by default in oh-my-zsh, the very least will be annoying. Why? You could have set up your own PATH and then this will brake functionality you've explicitly set up.



Now what the author is trying to say - bash environments do not have $HOME/bin and /usr/local/bin in their default PATH, however, both places are quite popular for packets(/usr/local/bin is where anything you install lives in UNIX systems like FreeBSD while $HOME/bin is usually for user installed packets that were installed without root privileges).



Lastly, you can set up your PATH the best way that fits your needs. A good way will be to start with examining what's currently in your PATH and adding any extra paths to it as you find fit



export PATH=/some/path:$PATH






share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 22 at 18:24









man0v

1014




1014












  • I will be using brew for installing packages. There are some recommendations out there - on how to setup $PATH variable. Brew creates symlinks when it installs packages. If $PATH is not set right, it can create some headaches when using brew installed packages. What do you think is the best approach from that perspective?
    – Akshayraj Kore
    Feb 22 at 18:32










  • Well, I've used brew with zsh(not oh-my-zsh) and I've had no problems apart from when using packages that already exist in the system(like python for instance). The best approach will be to do whatever brew documentation suggests. If you ever run into issues, you can always modify your PATH to resolve.
    – man0v
    Feb 22 at 18:45


















  • I will be using brew for installing packages. There are some recommendations out there - on how to setup $PATH variable. Brew creates symlinks when it installs packages. If $PATH is not set right, it can create some headaches when using brew installed packages. What do you think is the best approach from that perspective?
    – Akshayraj Kore
    Feb 22 at 18:32










  • Well, I've used brew with zsh(not oh-my-zsh) and I've had no problems apart from when using packages that already exist in the system(like python for instance). The best approach will be to do whatever brew documentation suggests. If you ever run into issues, you can always modify your PATH to resolve.
    – man0v
    Feb 22 at 18:45
















I will be using brew for installing packages. There are some recommendations out there - on how to setup $PATH variable. Brew creates symlinks when it installs packages. If $PATH is not set right, it can create some headaches when using brew installed packages. What do you think is the best approach from that perspective?
– Akshayraj Kore
Feb 22 at 18:32




I will be using brew for installing packages. There are some recommendations out there - on how to setup $PATH variable. Brew creates symlinks when it installs packages. If $PATH is not set right, it can create some headaches when using brew installed packages. What do you think is the best approach from that perspective?
– Akshayraj Kore
Feb 22 at 18:32












Well, I've used brew with zsh(not oh-my-zsh) and I've had no problems apart from when using packages that already exist in the system(like python for instance). The best approach will be to do whatever brew documentation suggests. If you ever run into issues, you can always modify your PATH to resolve.
– man0v
Feb 22 at 18:45




Well, I've used brew with zsh(not oh-my-zsh) and I've had no problems apart from when using packages that already exist in the system(like python for instance). The best approach will be to do whatever brew documentation suggests. If you ever run into issues, you can always modify your PATH to resolve.
– man0v
Feb 22 at 18:45


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1297418%2fwhat-is-the-right-way-to-set-path-variable-in-zshrc%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Plaza Victoria

In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...