Adding a new entry to the PATH variable in ZSH

后端 未结 6 1978
暗喜
暗喜 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条回答
  •  粉色の甜心
    2020-11-29 15:21

    one liner, without opening ~/.zshrc file

    echo -n 'export PATH=~/bin:$PATH' >> ~/.zshrc
    

    or

    echo -n 'export PATH=$HOME/bin:$PATH' >> ~/.zshrc
    

    To see the effect, do source ~/.zshrc in the same tab or open a new tab

提交回复
热议问题