1. 程式人生 > >-bash: ls: No such file or directory 產生的原因及修改方法

-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
[email protected]:~$ 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
版權宣告:本文為博主原創文章,轉載請附上博文連結!