-bash: ls: No such file or directory 错误的原因及解决办法

Posted carriezhangyan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了-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。

以上是关于-bash: ls: No such file or directory 错误的原因及解决办法的主要内容,如果未能解决你的问题,请参考以下文章

hadoop使用HDFS报错:ls: `.': No such file or directory

解决hadoop中 bin/hadoop fs -ls ls: `.': No such file or directory问题

Hadoop hdfs 显示 ls: `/home/hduser/input/': No such file or directory 错误

"ls: cannot access sys/class/ieee80211: No such file or directory" .

error while loading shared libraries: libg2o_core.so: cannot open shared object file: No such file o

rpm:error while loading shared libraries: libz.so.1: cannot open shared object file: No such file o