I have done the typical newbie error and have moved important bash folders by mistake using the command;

sudo mv /* ../../../../../programmingajax.com/

This has then gone and moved lots of important files and folders resulting in me not being able to use the command line properly.

However reading around the internet I found this which explains that I should use busybox to use commands such as mv.

So I ran this command to move all the folders back to there original location;

../../../../../programmingajax.com/bin/busybox mv ../../../../../programmingajax.com/* /

After doing that it now tells me that I cannot move (rename) these files as I do not have permission.

So I read here that I can use su

So I ran the command to try and move the folders back this time using su;

../../../../../programmingajax.com/bin/busybox su ../../../../../programmingajax.com/bin/busybox mv ../../../../../programmingajax.com/* /

But I get the error su: must be suid to work properly

Is there a way I can rectify this?

  • what about a using live-CD to turn all back. – retrokun Nov 23 '16 at 16:20
  • 1
    See this. Since you do not have a root shell, using live CD will be the best option. – Ron Nov 23 '16 at 16:26
  • Sorry bit confused on how would I go about this? As I am running it on VMWare I tried to go into recovery mode using the "shift" key but nothing happens, it just logs back into the main desktop. – mp252 Nov 23 '16 at 16:33
  • 1
    Does this work? ../../../../../programmingajax.com/bin/sudo ../../../../../programmingajax.com/bin/mv ../../../../../programmingajax.com/* / – Evan Chen Nov 24 '16 at 5:30
  • @EvanChen: Good approach but it's actually more complicated because sudo is linked dynamically and the dynamic loader is not where it's supposed to be (/lib/ld-linux.so.*) and neither are the dynamic libraries (/lib). So it'd actually have to be LD_LIBRARY_PATH="../../../../../programmingajax.com/lib/$(uname -m)-linux-gnu" ../../../../../programmingajax.com/lib/ld-linux.so.2 ../../../../../programmingajax.com/bin/sudo ../../../../../programmingajax.com/bin/mv ../../../../../programmingajax.com/* /. Bottom line: just use a live system; it'll be much easier. – David Foerster Nov 27 '16 at 23:35

Your Answer

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

Browse other questions tagged or ask your own question.