Adding a new entry to the PATH variable in ZSH

后端 未结 6 1982
暗喜
暗喜 2020-11-29 14:43

I\'m using zsh and I\'m trying to add a new entry (/home/david/pear/bin) to the PATH variable but I don\'t know how.

The thing that confuse

6条回答
  •  萌比男神i
    2020-11-29 15:35

    Here, add this line to .zshrc:

    export PATH=/home/david/pear/bin:$PATH
    

    EDIT: This does work, but ony's answer below is better, as it takes advantage of the structured interface ZSH provides for variables like $PATH. This approach is standard for bash, but as far as I know, there is no reason to use it when ZSH provides better alternatives.

提交回复
热议问题