问题出现:
1、终端中vim ~/.bash_profile,打开了.bash_profile文件,并向其中添加一条并不需要的指令并保存退出:export PATH=”/Users/moyihang/Library/Application Support/GoodSync”:$PATH
2、然后,source ~/.bash_profile 更新了.bash_profile文件,此时报错
3、此时输入vi、vim、open、ls等命令行均提示: command not found
解决方法:
Terminal 执行以下命令:
1、export PATH=/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
2、open -e .bash_profile
打开了.bash_profile文件后,删除之前错误添加的配置,command +s 保存退出
此时,尝试ls、vim ~/.bash_profile等命令均恢复正常使用了