How to Access Your iCloud Drive Folder in the Terminal App

iCloud Drive is available as a folder in the Finder on macOS Yosemite (10.10) and later. However, iCloud Drive doesn’t act like a normal Finder folder, which is problematic when you want to work with iCloud Drive in the Terminal app:

  • iCloud Drive is not listed as a folder in your home folder
  • You can’t drag the iCloud Drive icon at the top of a Finder window onto the Terminal to copy and paste its path

Although seemingly inaccessible, iCloud Drive is squirrelled away by macOS in your Library folder:

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

The following command changes the current working folder to your iCloud Drive folder:

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

That’s a lot to type each time you want to work with iCloud Drive on the command line. You can make life easier for yourself by setting up an alias in your Bash profile. Add the following line to your .bash_profile file with a text editor:

alias ic='cd ~/Library/Mobile\ Documents/com~apple~CloudDocs'

Since .bash_profile is a hidden file, you won’t ordinarily see it listed in the Finder. Use the following command to open your .bash_profile file in the default text editor:

open ~/.bash_profile

Now, to starting working with iCloud Drive on the command line, open Terminal and type:

ic

and you will be taken to your iCloud Drive folder. Although I’ve used the alias ic, you can use whatever suites you.