How do I access my iCloud Drive folder from Terminal?

Varinder Singh picture Varinder Singh · Sep 22, 2014 · Viewed 11.7k times · Source

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?

Answer

mixja picture mixja · Oct 17, 2014
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