Help with Copying data from Terminal

Discussion in 'OS X Mountain Lion (10.8)' started by rimmi2002, Jul 20, 2013.

  1. macrumors member

    Joined:
    Apr 6, 2011
    #1
    Hi I have a MBA that crashed on me while doing an Microsoft office update. I have to reinstall Mountain Lion. The problem is that I have alot of talks (powerpoint presentations that I made) on the computer that I don't want to risk loosing.

    If I use the recovery utility to get to the install page and then use terminal...can someone please tell me how can I copy the contents of my user folder or the contents of my desktop and documents folder to an external HD or USB?

    Thanks for your help!
     
  2. MacUser2525, Jul 20, 2013
    Last edited: Jul 20, 2013

    macrumors 65816

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #2
    Once you have terminal open if you know the Volume name of your install and backup drive then.

    Code:
    cp /Volumes/Your_Volume_Name/Users/Your_User_Name /Volumes/Your_Backup_Volume_Name/
    
    That copies your entire user directory to your backup drive if you do not know the names then.


    Code:
    diskutil list
    
    Or

    Code:
    ls -l /Volumes/
    
    To see a list of the mounted volumes. If you have spaces in your volume names then you need to escape the space with a \ like so for my first example.

    Code:
    cp /Volumes/Your\ Volume\ Name/Users/Your_User_Name /Volumes/Your\ Backup\ Volume\ Name/
    
    To do just the folders using my first example.

    Code:
    cp /Volumes/Your_Volume_Name/Users/Your_User_Name/Desktop /Volumes/Your_Backup_Volume_Name/
    cp /Volumes/Your_Volume_Name/Users/Your_User_Name/Documents /Volumes/Your_Backup_Volume_Name/
    
    Edit: If your volumes are not mounted quit Terminal and open Disk Utility to mount them then quit it and go back to Terminal.

    Edit2: Now I think about it Desktop may not be a copyable folder so use this to get everything contained on it if that is true.

    Code:
    mkdir /Volumes/Your_Backup_Volume_Name/Desktop
    
    cp /Volumes/Your_Volume_Name/Users/Your_User_Name/Desktop/* /Volumes/Your_Backup_Volume_Name/Desktop/
    
     
  3. thread starter macrumors member

    Joined:
    Apr 6, 2011
  4. macrumors 65816

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #4
    Your welcome.
     

Share This Page