What is the right way to set $PATH variable in zshrc
up vote
1
down vote
favorite
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
add a comment |
up vote
1
down vote
favorite
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
1
Maybe my answer to another question might give you some further information on how to set yourPATH
variable effectively.
– mpy
Feb 22 at 19:28
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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
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
bash shell zsh .bash-profile oh-my-zsh
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 yourPATH
variable effectively.
– mpy
Feb 22 at 19:28
add a comment |
1
Maybe my answer to another question might give you some further information on how to set yourPATH
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
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
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
I will be usingbrew
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 usedbrew
withzsh
(notoh-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 whateverbrew
documentation suggests. If you ever run into issues, you can always modify yourPATH
to resolve.
– man0v
Feb 22 at 18:45
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
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
I will be usingbrew
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 usedbrew
withzsh
(notoh-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 whateverbrew
documentation suggests. If you ever run into issues, you can always modify yourPATH
to resolve.
– man0v
Feb 22 at 18:45
add a comment |
up vote
0
down vote
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
I will be usingbrew
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 usedbrew
withzsh
(notoh-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 whateverbrew
documentation suggests. If you ever run into issues, you can always modify yourPATH
to resolve.
– man0v
Feb 22 at 18:45
add a comment |
up vote
0
down vote
up vote
0
down vote
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
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
answered Feb 22 at 18:24
man0v
1014
1014
I will be usingbrew
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 usedbrew
withzsh
(notoh-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 whateverbrew
documentation suggests. If you ever run into issues, you can always modify yourPATH
to resolve.
– man0v
Feb 22 at 18:45
add a comment |
I will be usingbrew
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 usedbrew
withzsh
(notoh-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 whateverbrew
documentation suggests. If you ever run into issues, you can always modify yourPATH
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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