The command could not be located because '/usr/bin' is not included解决


The command could not be located because '/usr/bin' is not included解决
 
    用的是Ubuntu12.04。
   为了把adb命令设置到环境变量中,我在~/.bashrc文件中加入了如下命令:
export PATH=/home/develop/android-sdks/platform-tools/
    结果悲剧了.输入常用命令ls,cd ,,,都不行。连vi也不行。一律报错。The command could not be located because '/usr/bin' is not included in the PATH environment variable.clear: command not found.
    看半天才知道忘加系统PATH的路径,所以系统工具命令都找不到。
    可怎么把配置文件改过来呢,折腾了半天,发现很简单。直接用系统工具的全路径编辑配置文件。我用的是sudo vi /usr/bin/vi ~/.bashrc.
然后加入命令 export PATH=/home/develop/android-sdks/platform-tools/:$PATH。再重启终端就好了。
    学到了两点:
    1.系统命令找不到时,通常是路径不对,直接在命令行用全路径即可;
    2.在设置环境变量时,尤其是linux系统中,你加入自己的环境变量,可还要附带上之前的变量。如最后加上:$PATH

相关内容

    暂无相关文章