刚刚误操作把 环境变量设置错了。导致执行任何命令都提示
The command could not be located because ‘/usr/bin’ is not included in the PATH environment variable
通常的解决办法:把错误的环境变量删掉 再source一下。
但是,vi都无法使用了。
解决办法:改为使用绝对路径去编辑:
/usr/bin/vi /etc/profile
再source回去。
百度到的答案:
export PATH="/usr/bin:$PATH"
之后就可以使用source了,把/etc/profile 改成正确的。解决问题。