How To Access iCloud Drive Through Terminal On Mac

We’re sure that many Mac users here need to use Cloud Drive from the Terminal of your Mac OS. When the iCloud Drive does not appear in the Home directory, there is only one way to access the iCloud Drive is using the Terminal. The reason is that iCloud Drive appears someplace else in the MacOS directory. So, if you want to access to iCloud Drive from Terminal, you need to browse around in your Library folder.

Before proceeding, you should make sure to enable the iCloud Drive on your Mac and have an internet connection. If these requirements are not fulfilled, the process won’t be successful.

Open iCloud Drive Through Terminal on Mac

Here is the command line to the iCloud Drive:

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

The ~ symbol is a shortcut representing for your home directory but it can be used to annunciate the entire path to a specific folder. So, to access the iCloud Drive from the Mac OS Terminal, you need to use the ‘cd’ command and locate the directory of the iCloud documents path. You can use this full command to access iCloud Drive from Terminal:

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

Once done, press the Return key to go back to iCloud Drive folder and then type ‘Is’ to list all the contents of the iCloud Drive folder. You can also type ‘pwd’ to print the working directory.

Another way that almost of Mac users can access the iCloud Drive is using the Finder. You can do it just by clicking on it in the sidebar or navigating to the Go menu. However, the advanced users like using the command line to do so in a direct manner because of its convenience.

Copy Files to iCloud Drive from Terminal

To copy the files to iCloud Drive, you can use the cp command. For example, to copy a file named ‘photos.zip’ from your desktop to the directory of iCloud Drive, all you need to do is simply typing in the following command:

cp ~/Desktop/photos.zip~/Library/Mobile\Documents/com~apple~CloudDocs/

It’s similar to copying other files via Terminal.

Also see: Methods To Fix External Hard Drive Not Showing Up On Mac

Move Files to iCloud Drive from Terminal

Similarly to copying files to iClould Drive, it is possible to move a file to the iCloud Drive using the command line from Terminal. Although it will upload to iCloud Drive, it will then be removed from the file system. You can do it by using the mv command and it is not difficult to perform. Simply enter the given below command for moving files:

mv ~/Desktop/photos.zip ~/Library/Mobile\ Documents/com~apple~CloudDocs/

But you need to take note that the process to upload the file to the iCloud server could take some time to complete. What do you think of using Terminal as compared to using the Finder? Let’s know in the comment below.

Leave a Reply

Your email address will not be published. Required fields are marked *