0

I elevated to root user with sudo su then I made the mistake of trying to move a file to my logged in profile's desktop with mv a.zip ~/desktop. As a result, I am unable to locate the a.zip file. I tried searching the file system through the GUI. Moreover while still elevated as root the cd ~/desktop command says location does not exist.

Where is a.zip now? This occurred in OSX operating system, v10.11 I believe.

2
  • 4
    sudo su again, then cd ~/ and then ls. My suspicion is that you have a new file called desktop that looks like your zip.
    – Mokubai
    Jul 10, 2017 at 16:58
  • @Mokubai I found it there as you said and I was able to recover its contents. Thank you much.
    – ThisClark
    Jul 11, 2017 at 1:38

1 Answer 1

1

It most likely went to /root/desktop/a.zip or /root/desktop (if /root/desktop does not exist as a directory)

Once you ran sudo su, you became root entirely, and root's home is /root.

Edit: I see you are using OSX, under OSX root's home is usually /var/root/, so look for /var/root/desktop/a.zip or /var/root/desktop

1
  • In this case, the location ~/ was the same as /var/root and the way I used the mv command caused the file to be renamed to desktop. I was able to restore the file by moving it to a proper location and giving it back its .zip extension.
    – ThisClark
    Jul 11, 2017 at 1:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .