Celeb Glow
general | March 02, 2026

Debian : -bash: ls: command not found

I have a vm to play with linux and wanted to try rbash. I followed a tutorial to make it work. Then I wanted to remove the stuff i've done, and delete a symlink from /bin/ls to /etc/skel/. But instead of using unlink command, I use rm -r on /etc/skel/ls and deleted the binary Ls from /bin/ folder (literaly).

Now I've got -bash: ls: command not found when I want to use ls command. Is there a way to reinstall this default command ? To download the bin ?

1

1 Answer

Depends on what Linux distro you are using.

Typically, you can force reinstall a package, and hence, get back all its files.

For example, in a Debian based system, like Ubuntu, you'll see:

dpkg -S /bin/ls

"ls" belongs to "coreutils".

Therefore, force reinstall the package:

sudo apt-get --reinstall install coreutils

And, your accident will be fixed!

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy