Sylvestre's blog

-bash: /bin/ls: No such file or directory

· Sly · Administration, Linux · 1 commentaire

If you have done a mistake/lost the /lib/ directory. Example :

mv lib lib.

And you are stuck without anything working :

# ls
-bash: /bin/ls: No such file or directory

Don't waste your time in a reinstallation, there is a trick :

/lib./ld-linux.so.2 --library-path /bin/ mv /lib. /lib/

It invokes the program loader directly and the problem will be fixed (of course, you can use this command to call many programs).

1 commentaire

Joel Mejia ·

Yeah, your answer is right, but I have a little problem more. The next error appear when I execute the command you said:
error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

So I edit the /etc/ld.so.conf file and add the next line /lib. and then execute the ldconfig command and then the command you said again, and it works fine.

Thank you

Les commentaires sont clos : ce blog est une archive statique.