PDA

View Full Version : Help with Copying data from Terminal




rimmi2002
Jul 20, 2013, 01:14 PM
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!



MacUser2525
Jul 20, 2013, 09:40 PM
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!

Once you have terminal open if you know the Volume name of your install and backup drive then.


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.



diskutil list


Or


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.


cp /Volumes/Your\ Volume\ Name/Users/Your_User_Name /Volumes/Your\ Backup\ Volume\ Name/


To do just the folders using my first example.


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.


mkdir /Volumes/Your_Backup_Volume_Name/Desktop

cp /Volumes/Your_Volume_Name/Users/Your_User_Name/Desktop/* /Volumes/Your_Backup_Volume_Name/Desktop/

rimmi2002
Jul 21, 2013, 12:04 PM
Thanks! This really helps.

MacUser2525
Jul 21, 2013, 01:08 PM
Thanks! This really helps.

Your welcome.