Ubuntu环境变量恢复

解决方法一:

问题:系统找不到环境变量

在终端输入:ls 后显示:

root@wei:/etc# 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

解决办法:

直接在终端输入:export PATH=/usr/bin:/bin

完成后则可以使用相关命令了。



作者:LeviXAO
链接:https://www.jianshu.com/p/624797bd2ad0
来源:简书

解决方法二:

问题:

  出现这个错误-bash: 路径xx: No such file or directory除了cd能用外,所有linux命令都不能用,一般导致问题原因是etc/profile配置文件出错导致

一、解决方法:
      打开终端输入以下命令让所有命令启作用

       export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

二、修改profile文件出错的路径
       -bash: /usr/local/xxxx: No such file or directory

三、重启问题解决

原文地址:https://www.cnblogs.com/shadow-97z/p/12462841.html