I would like to access iCloud drive from Terminal in order to create an emergency backup. Unfortunately, my installation of Mac OS Yosemite is not operational, so I am using recovery mode to create my backup. In this mode, the Finder is not available and iCloud Drive is not running.

I am aware that normally, the iCloud drive directories are located at ~/Library/Mobile\ Documents/com~apple~CloudDocs. Unfortunately this directory does not appear when using Terminal in recovery mode (there appears to be no Mobile Documents in Library). This makes sense, because I am not logged in as any of the users (and I believe the recovery utility runs on its own partition).

My questions are thus:

  1. Is there any way I can connect to and access iCloud drive directories from Terminal in Mac OS recovery mode (i.e. after booting up while holding down cmd + r) when iCloud Drive sync is not running (as Finder isn't running)?
  2. How can I copy all files in a given folder (including all subfolders) into an iCloud drive directory using a Terminal command?

Should it not be possible to log into iCloud drive using Terminal, Dropbox would be an alternative. I am not sure, however, whether I can install the Dropbox command line tool in recovery mode.

2 Answers 2


I think you're going the wrong way.

  • Why are you trying to recover these files?
  • Reinstall the OS from CMD + R and log in again.
  • Now you can back up all your documents.
  • The reinstall will not delete your files until you don't format the disk/s.

BTW. you could log in to iCloud via www.icloud.com and get your files from there.

Another solution could be:

  • Download the latest Combo Update for your installed OS (for ex. https://support.apple.com/kb/DL1832?locale=de_DE)
  • and turn the damaged OS into Target Disk Mode by holding the "T" key on startup.
  • Now connect your damaged OS via Firewire or Thunderbolt (or even with a FW to TB converter/adapter)
  • and run from your working Yosemite installation the Combo Update installer.
  • Choose as destination the damaged OS from Target Disk Mode.
  • In many cases, the Combo Update can fix some issues without having to reinstall the whole OS. But that's only a temporary solution.
  • The issue should be resolved.

Btw. I don't understand why you're trying to recover the files from the disk when the files are already on iCloud. What's your intention? Perhaps we could help you better if we know what the intention is.

Best regards


This post is very old, but in case anyone stumbles on here looking for the answer (as I did) here’s where you can find the iCloud Drive while in recovery mode:

/Volumes/Macintosh HD - Data/Users/[your username]/Library/Mobile Documents/com~apple~CloudDocs

You must log in to answer this question.

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