-bash: ls: No such file or directory 产生的原因及修改方法

ubuntu出现如下错误:

{

Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.15.0-42-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

77 packages can be updated.
0 updates are security updates.

*** System restart required ***
Last login: Fri Dec  7 13:59:33 2018 from 10.12.21.2
-bash: ls: No such file or directory
-bash: lesspipe: No such file or directory
-bash: dircolors: No such file or directory
-bash: ls: No such file or directory
carrie@carrie-MMLP7AP-V7:~$ sudo su -l
Command 'sudo' is available in '/usr/bin/sudo'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
sudo: command not found

}

 

原因是:

默认的环境变量错误,

#cat /etc/profile

export PATH=

 

修改错误:

# export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin 

# reboot

 

重启机器,登陆OK。
---------------------
作者:IT界的佛系少女
来源:CSDN
原文:https://blog.csdn.net/qq_38693296/article/details/84935566
版权声明:本文为博主原创文章,转载请附上博文链接!

转载于:https://www.cnblogs.com/carriezhangyan/p/10094972.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值