问题的出现
修改了Mac电脑 ~/.bash_profile 文件后,执行
source ~/.bash_profile
问题出现了,很多命令,包括ls命令都无法使用。
问题原因
原因是之前安装使用了oh-my-zsh,.zshrc存储了各种设置,又执行了.bash_profile更改了设置,导致zsh无法使用。
解决步骤
- 新建一个finder窗口
- 前往文件夹
~/
- 找到并打开文件
.zshrc
如果没有找到,先显示隐藏文件,同时按住“ Command + Shift + . ”三个按键即可
- 找到此行代码
# User configuration
- 在下方添加
source .bash_profile
- 新建终端,执行
source ~/.zshrc