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?
12 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.)
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.