7 Replies Latest reply: May 28, 2014 10:05 PM by Camelot
charliefromcheltenham Level 1 Level 1 (0 points)

Hi there,

 

I recently tried set up a connection with a server, and instead of uploading just the key pair to a file on my desktop, I seem to have deleted the whole desktop - this what I ran on Terminal.

 

 

 

mkdir ~/.ec2

cd ~/Desktop

mv *.pem ~/.ec2

cd ~/Desktop/ec2-api-tools-1.3-19403/  #depends on ec2 tools folder name

mv * ~/.ec2Last login: Sat Dec  3 15:21:19 on console

Charlie-Storeys-iMac:~ charliestorey$ mkdir ~/.ec2

Charlie-Storeys-iMac:~ charliestorey$ cd ~/Desktop

Charlie-Storeys-iMac:Desktop charliestorey$ mv *.pem ~/.ec2

Charlie-Storeys-iMac:Desktop charliestorey$ cd ~/Desktop/ec2-api-tools-1.3-19403/  #depends on ec2 tools folder name

-bash: cd: /Users/charliestorey/Desktop/ec2-api-tools-1.3-19403/: No such file or directory

Charlie-Storeys-iMac:Desktop charliestorey$ mv * ~/.ec2

 

 

 

 

Charlie-Storeys-iMac:Desktop charliestorey$

Charlie-Storeys-iMac:Desktop charliestorey$

Charlie-Storeys-iMac:Desktop charliestorey$ mkdir ~/.ec2

mkdir: /Users/charliestorey/.ec2: File exists

Charlie-Storeys-iMac:Desktop charliestorey$ cd ~/Desktop

Charlie-Storeys-iMac:Desktop charliestorey$ mv *.pem ~/.ec2

mv: rename *.pem to /Users/charliestorey/.ec2/*.pem: No such file or directory

Charlie-Storeys-iMac:Desktop charliestorey$ cd ~/Desktop/ec2-api-tools-1.5.0.1-2011.11.30/  #depends on ec2 tools folder name

-bash: cd: /Users/charliestorey/Desktop/ec2-api-tools-1.5.0.1-2011.11.30/: No such file or directory

Charlie-Storeys-iMac:Desktop charliestorey$ mv * ~/.ec2

 

 

 

 

After this, my whole desktop has been cleared - can anyone think

 

 

a) where the files might have gone (I have searched for folders that were there, and they are not on my harddrive)

b) how to reverse it?

 

Hope that the files haven't been sent to the server, as I can't get onto it at the moment!

 

 

Any help much appreciated,

 

Thanks,

 

Charlie

  • Niel Level 10 Level 10 (278,470 points)

    Choose Go to Folder from the Finder's Go menu, provide ~/Desktop/.ec2 as the path, and drag anything you find there to the desktop.

     

    (62154)

  • charliefromcheltenham Level 1 Level 1 (0 points)

    Hi Neil,

     

    Thanks for this, but sadly there is no file with that name - that's what's so weird....

     

    Any other ideas? Do you think i have pushed it onto the server named??!

     

    Charlie

  • Linc Davis Level 10 Level 10 (164,525 points)

    You moved everything from the Desktop folder into a folder named ".ec2" at the root level of your home folder. Because its name starts with a period, that folder is invisible in the Finder. To reverse this action, copy or drag -- do not type -- the following command into a Terminal window, then press return:

     

    mv ~/.ec2/* ~/Desktop/

  • charliefromcheltenham Level 1 Level 1 (0 points)

    Hi Linc,

     

    Thank you SO SO much - everything has been returned exactly as it was - I really cannot thank you enough.

     

     

     

    Makes a lot of sense - just couldn't understand how to view that file after Niel's post - but this has put everything back just fine!

     

    Thanks again,

     

    Charlie

  • Doucet91 Level 1 Level 1 (0 points)

    Omg god i am hoping someone can help

     

    I had the similair issue with my mac. I was trying to remove an application and recieved an error stating the file was is use. So i was reading up on removing files and found this

     

    basically I need to open terminal 

     

    "sudo rm -rf zimbra desktop

    See below for what was typed

     

    (did this origninally  Chris$ cd ~/.Trash )

    Chris$ sudo rm -rf /Users/Chris/.Trash/Zimbra\ Desktop

    Chris$ cd ~/.Trash history

     

    Below are some other things i did that move a directory of a user file which i am not concern with just the main desktop i can no longer find

     

     

     

     

    Chris-Falardeaus-Computer:~ Chris$

    Chris-Falardeaus-Computer:~ Chris$ mv ~/zimbra desktop/* ~/Desktop/

    mv: rename /Users/Chris/zimbra to /Users/Chris/Desktop/zimbra: No such file or directory

    mv: rename desktop/* to /Users/Chris/Desktop/*: No such file or directory

    Chris-Falardeaus-Computer:~ Chris$ mv ~/.ec2/* ~/Desktop/

    mv: rename /Users/Chris/.ec2/* to /Users/Chris/Desktop/*: No such file or directory

    Chris-Falardeaus-Computer:~ Chris$ mv ~/* ~/Desktop/

    mv: rename /Users/Chris/Desktop to /Users/Chris/Desktop/Desktop: Invalid argument

    mv: rename /Users/Chris/Documents to /Users/Chris/Desktop/Documents: Permission denied

    mv: rename /Users/Chris/Library to /Users/Chris/Desktop/Library: Permission denied

    mv: rename /Users/Chris/Movies to /Users/Chris/Desktop/Movies: Permission denied

    mv: rename /Users/Chris/Music to /Users/Chris/Desktop/Music: Permission denied

    mv: rename /Users/Chris/Pictures to /Users/Chris/Desktop/Pictures: Permission denied

    mv: rename /Users/Chris/Public to /Users/Chris/Desktop/Public: Permission denied

    mv: rename /Users/Chris/Sites to /Users/Chris/Desktop/Sites: Permission denied

    Chris-Falardeaus-Computer:~ Chris$ desktop mv ~/Thomas Doucet/* ~/Desktop

    -bash: desktop: command not found

    Chris-Falardeaus-Computer:~ Chris$ desktop mv ~/ThomasDoucet/* ~/Desktop

    -bash: desktop: command not found

    Chris-Falardeaus-Computer:~ Chris$ bash

    bash-3.2$ desktop

    bash: desktop: command not found

    bash-3.2$ destop /

    bash: destop: command not found

    bash-3.2$ logout

    bash: logout: not login shell: use `exit'

    bash-3.2$ exit

    exit

    Chris-Falardeaus-Computer:~ Chris$ find

    usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]

           find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]

    Chris-Falardeaus-Computer:~ Chris$ find thomas malcew

    find: thomas: No such file or directory

    find: malcew: No such file or directory

    Chris-Falardeaus-Computer:~ Chris$ hd

    -bash: hd: command not found

    Chris-Falardeaus-Computer:~ Chris$ macintosh hd find

    -bash: macintosh: command not found

    Chris-Falardeaus-Computer:~ Chris$ hd

    -bash: hd: command not found

    Chris-Falardeaus-Computer:~ Chris$

  • airnessdave Level 1 Level 1 (0 points)

    Hello to all Apple Great Stuff
    This is Dave

    Yesterday,trying to delete an undeletable file from the trash, i ran over a terminal forum

    e copied  rm -rf * then clicked RETURN
    and cleared up all my files on the desktop (60GB MUSIC AND OTHERS)
    Since my job is to be a musician, it's a real disaster,if you please can help me out.
    Things to know: - the only deleted folders were DESKTOP AND DOWNLOAD
    -all my files in documents and applications are still there.
    -Tried to do ,as i read on a Linc Davis              review forum :

    You moved everything from the Desktop folder into a folder named ".ec2" at the root level of your home folder. Because its name starts with a period, that folder is invisible in the Finder. To reverse this action, copy or drag -- do not type -- the following command into a Terminal window, then press return:       mv ~/.ec2/* ~/Desktop/

    but this is the message i get : No such file or directory  adsl-ull-254-242:- mm$

    - I didnt type any folder name while processing rm-rf * on terminal.
    -I'm running mavericks in a Imac 21.5" Vers.10.9.3    Processor 3.06GHz IntelCore3 /  Memory 4GB 1333MHz  DDR3
    if anyone can be of help,i'd need my desktop back aiting for your reply i thank you indeed
    Dave Italy

  • Camelot Level 8 Level 8 (46,395 points)

    #1 - your question in no way relates to the original post. Next time consider starting a new thread rather than resurrecting this >2 yr old thread.

     

    #2 - your files are gone. Your post doesn't actually relate to the original poster's problem. Instead you blindly deleted a good chunk of files. That's what this command does:

     

    rm -rf *

     

    Quite literally, this command tells the OS to delete all the files and folders in the current directory - or, at least try... as you've noticed some stuff remains, mostly due to safeguards put in place by Apple, but there's only so much you can do.

     

    Your solution, though, is simple. Restore from a backup.

    You do have a backup, right? Since this data is so important to your work I hope you're not going to tell me that it wasn't backed up. If it wasn't backed up your options are to recreate the data, or turn your computer off now and send your drive to a data recovery specialist. I'm not aware of any personal file recovery files that are up to date with the latest OS.