I have mistakenly deleted the ls
executable from the /bin
folder.
Can I recover it or install it through the terminal?
You could check which package brings ls
binary using dpkg
:
$ dpkg -S /bin/ls
coreutils: /bin/ls
dpkg
will show you that it is package coreutils
. Now you only need to reinstall it:
$ sudo apt-get install --reinstall coreutils
I know that my answe is coming is too late but it will assist others in the future.
I had deleted ls
command
As a root user,
Use
# sudo apt update
Then after the update,
Type your deleted command. In my case
# ls
Then you'll see a prompt
Command 'ls' not found can be installed with:
apt install coreutils
Do you want to install it? (N/y) then type y
You're done wait for it to update! Go back confirm if it is done As a root user type the deleted command
ls
trash-cli
for the future.)