解决 zsh:command not found

时间:2024-01-03 18:10:41 买帖  | 投诉/举报

篇首语:本文由小编为大家整理,主要介绍了解决 zsh:command not found相关的知识,希望对你有一定的参考价值。

一、原因

最新系统的macbook把zsh作为默认shell,而环境变量添加到了bash中,把 bash shell 中.bash_profile 全部环境变量加入zsh shell里就可以啦

二、解决办法

1、打开终端,然后输入下面命令,查看.bash_profile的配置,复制

cat .bash_profile

2、然后输入下面命令打开.zshrc,把刚才.bash_profile复制的内容粘贴进来,然后:wq保存退出

vim .zshrc

3、输入下面命令更新配置

source ~/.zshrc

以上是关于解决 zsh:command not found的主要内容,如果未能解决你的问题,请参考以下文章