当我尝试在终端中运行时,出现错误The command could not be located because '/usr/bin' is not included in the PATH environment variable。
例如。
jeper@jeper:~$ clear
Command 'clear' is available in '/usr/bin/clear'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
clear: command not found
Run Code Online (Sandbox Code Playgroud)
和喜欢
jeper@jeper:~$ vi
Command 'vi' is available in '/usr/bin/vi'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
vi: command not found
Run Code Online (Sandbox Code Playgroud)
问题是什么以及解决方法是什么?
小智 4
看起来你的 $PATH 是空的。尝试一下echo $PATH,输出应该与此类似:
/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/root/bin
Run Code Online (Sandbox Code Playgroud)
如果没有,您应该检查您的.bash_profile或.bashrc. 或者如果使用su username命令切换用户,su - username下次应该使用。