Accessing iCloud Drive isn’t so obvious from Terminal because Apple uses this weird path.
~/Library/Mobile\ Documents/com\~apple\~CloudDocs
Fortunately you can use a symbolic link or a symlink so that you could easily access your documents in iCloud Drive from Terminal with something like this:
~/iCloud
You can do this using the link
command or its alias ln
from Terminal. So let’s say we’ll want to create a symlink to iCloud
in your home folder ~
. You’ll want to run this command,
ln -s ~/Library/Mobile\ Documents/com\~apple\~CloudDocs ~/iCloud
-s
in the command above is the option according to man link
the manual pages, is to create a symbolic link.
Then we pass the source folder and then pass in the desired destination folder, which in this case I used ~/iCloud
.
So now from Terminal, I can easily get to my notes
folder in iCloud by typing this in:
vim ~/iCloud/notes