How to Access iCloud Drive Using Terminal on Mac

Some advanced users may need to access iCloud Drive via Terminal on Mac. Hence, we thought it's apt to make a quick guide about it.

Developers or advanced users may need to access iCloud Drive from the command line on Mac. Though the process is not so straightforward, it’s not difficult either.

So long as you know the command line, you can quickly copy and even move files to iCloud via Terminal on your Mac. Before going ahead with the process, you need to ensure that iCloud Drive is enabled on your Mac. If it’s not already, click on Apple Menu → System Preferences (or simply click on System Preferences icon) → iCloud and make sure it’s enabled. Besides, ensure that you have the proper Internet connection to access iCloud Drive and iCloud Drive files and documents using Terminal.

Sponsored Links

How to Access iCloud Drive Using Terminal on Mac

How to Access iCloud Drive Using Command Line on Mac


The command line path to iCloud Drive in macOS is:

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

Sponsored Links

The “~” tilde is a shortcut for the current users home directory. However, you have the option to illustrate it based on your need.

To access iCloud Drive in the Terminal on your Mac, you need to use “cd” command and then select the directory of the iCloud documents path.

To do so, use the following command:

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

Sponsored Links

Then, press the Return key to access iCloud Drive folder.

That’s it! Now, you will have access to iCloud Drive folder. Now, go ahead with your work.

How to Move Files to iCloud Drive by Terminal in Mac

Using command line, you can also move a file to iCloud Drive. It will upload to iCloud Drive and remove it from its original place. To do so, use the mv command.

mv ~/Desktop/images.jpeg ~/Library/Mobile\ Documents/com~apple~CloudDocs/

Sponsored Links

Now, your files will upload to the iCloud server.

How to Copy Files to iCloud Drive via Terminal on Mac

With the use of cp command, you can copy files to iCloud Drive via Terminal. The copied files are uploaded iCloud.

cp ~/Desktop/images.jpeg ~/Library/Mobile\ Documents/com~apple~CloudDocs/

That’s pretty much it!

Sponsored Links

Your take:

You’d like to take a peek at these posts as well:

Enjoyed this article? Download our app and stay connected with us via Facebook, Twitter, and Google Plus to read more such helpful guides.

Jignesh Padhiyar
Jignesh Padhiyar is the co-founder of who has a keen eye for news, rumors and all the unusual stuff that happens around Apple products. During his tight schedule, Jignesh finds some moments of respite to share side-splitting contents on social media.

Latest Articles

How to Permanently Delete Instagram Account from iPhone, Android, or PC

An overdose of social media might cause exasperating effects on your mind; for this reason, users decide to delete their Instagram accounts. Many users...

Best Sleep Tracker Apps for Apple Watch: Monitor The Time When You Snooze Mind

According to fitness experts, sound sleep is part and parcel of your fitness activities. Though there are some sleep tracking apps available for iPhone,...

Massive Giveaway from MacXDVD: MacX MediaTrans Giveaway & Win iPhone XR

It's almost Christmas, and everyone's having discounts going on. But what if I tell that there's a giveaway with three different campaigns? Yes, MacXDVD...

Qualcomm Case Takes a New Turn; Apple Ready to Push Software Update in China

A couple of days back Wall Street Journal reported that Apple was hit with a sales ban on older iPhones in China. Law authorities...