17

I'm running OS X Yosemite. I would like to save my code folder in iCloud Drive so that it's automatically backed up. I need to access files from the Terminal often, so how can I access iCloud Drive from the Terminal?

Kwow
  • 5
  • 5
Varinder Singh
  • 1,570
  • 1
  • 11
  • 25

3 Answers3

28
cd ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/

I would just add a symbolic link either to this folder or to a Source subfolder in your home directory to make working with this easier.

For example:

ln -s ~/Library/Mobile\ Documents/com\~apple\~CloudDocs ~/iCloud

and/or

ln -s ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/Source ~/Source
Edoardo
  • 4,485
  • 1
  • 27
  • 31
mixja
  • 6,977
  • 3
  • 32
  • 34
  • Following this advice, I found my Mac didn't have a ```Mobile\ Documents``` folder. A little further searching revealed it in my local area, so if you cannot find it, make sure your path is ```~/Users/Local/Library/Mobile\ Documents/etc..``` – Joe Jun 02 '16 at 12:53
-1

It´s in the Library Folder of the user. The folder-name is "MobileDocuments".

-1

It's in ~/Library/Mobile\ Documents/com\~apple\~QuickTimePlayerX/Documents/....

How to find it? You can drag a file in the finder and drop the file to the terminal, then the file path would be displayed in the terminal.

This is an awful way to get the path, I'm very curious about how to reveal it more naturally and easily and gracefully.

Jeff Tian
  • 5,210
  • 3
  • 51
  • 71