Access iCloud Drive quicker in Terminal by creating a symbolic link (symlink)

Written on May 31, 2019

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:


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

Stay in touch

Thanks for reading this article. I'd love to stay in touch and share more tips on programming and side projects with you. Sign up and I'll send you my articles straight to your email, you'll also get a free copy of the light themed version of my Git cheat sheet.
Git cheat sheet preview image