Accidentally moved /usr/bin

I'm using Ubuntu 14.04 and I've accidentally moved /usr/bin to another location.

Now most of the commands don't work anymore: sudo, cp...

The OS is not booting and I can't put the directory back as I have no permissions.

I also use zsh, and I suspect there were some zsh related files and symlinks.

How can I move the directory back?

1

2 Answers

If you simply moved the directory elsewhere (say /some/where), then move it back:

/some/where/sudo mv /some/where /usr/bin

(mv is /bin/mv, so no worries there.)

7

To move it back you need superuser permissions.

So navigate to the path where you moved using "cd".Yes, cd command will be available even you move the bin.

Then in the new bin directory

use:

./sudo /new/bin/path/mv new/bin/path /usr/bin/

./sudo to access sudo

./sudo /new/bin/path/mv to run mv (move command)

This should move back the folder in it's place.

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

You Might Also Like