在修改了~/.bashrc 中的变量刷新系统环境后出现了这个问题:
$ ls
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
料想肯定是环境变量配置有问题。
于是:
$ vim ~/.bashrc
Command 'vim' is available in '/usr/bin/vim'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
vim: command not found
意思是在本地环境变量中找不到这个指令了。
尝试直接访问vim在本地中的指令存放地址使用:
$ /usr/bin/vim ~/.bashrc
访问成功。
发现最后添加的export之后的 $PATH 缺了$。补全,wq保存后,重新刷新环境变量:
$ source ~/.bashrc
问题即解决。