因为使用的是zsh,而不是bash,所以即使修改~/.bash_profile之后,关闭终端重新打开依然需要重新使用source命令。
永久解决办法如下:
vim ~/.zshrc
编辑模式下,在第一行输入:
test -f ~/.bash_profile && source ~/.bash_profile
然后保存并退出,此时再source一下以使修改生效
source ~/.zshrc
因为使用的是zsh,而不是bash,所以即使修改~/.bash_profile之后,关闭终端重新打开依然需要重新使用source命令。
永久解决办法如下:
vim ~/.zshrc
编辑模式下,在第一行输入:
test -f ~/.bash_profile && source ~/.bash_profile
然后保存并退出,此时再source一下以使修改生效
source ~/.zshrc