Header Ads


How to Access iCloud Drive from Command Line in Mac OS

How to Access iCloud Drive from Command Line in Mac OS


Some Mac users may need to access iCloud Drive from the Terminal in Mac OS. But if you have tried to access iCloud Drive via command line on your own, you may have noticed it does not appear in the user Home directory. This is because iCloud Drive is actually locate elsewhere in Mac OS, and thus to access iCloud Drive from the command line you will need to dig around in the user Library folder instead of the Home folder. Well show you the full path for iCloud Drive access from the command line in Mac OS, and show you how to quickly and easily get to iCloud folders and files from the Terminal.

This should go without saying, but youll obviously need iCloud Drive to be enabled on the Mac, and have an active internet connection. Without those prerequisites you would not be able to access iCloud Drive from the command line, let alone the Finder. The command line path to iCloud Drive in Mac OS is as follows: Remember, the ~ tilde is a shortcut for the current users home directory, but you can also choose to annunciate the entire path for a specific user folder if desired like so: You must have an active internet connection to access iCloud Drive and iCloud Drive files and documents. To access iCloud Drive in the Terminal of Mac OS, simply use the familiar cd command and specify the directory of the iCloud documents path we detailed above.

Thus the full command to access iCloud Drive via terminal would be as follows: Hit the Return key and youll be in the iCloud Drive folder. You can confirm this by typing ls and listing the contents of the iCloud Drive folder, or by typing pwd to print the working directory. Of course most Mac users will just access iCloud Drive via the Finder by clicking on it in the sidebar or by going to the Go menu, but many advanced users will appreciate having direct command line access to iCloud Drive as well. For what its worth, it was only several versions of Mac OS ago where iCloud documents and what became iCloud Drive were hidden from even the Finder too, and you had to that we just detailed above, whereas now with modern Mac OS releases there is a simple always accessible iCloud Drive item in the Finder sidebar of MacOS.

Using the cp command you can copy files to iCloud Drive via Terminal, remember that by copying a file to iCloud Drive you are uploading it to iCloud Drive. As an example, lets say were going to copy a file named test.zip from the desktop to the main directory of iCloud Drive, the syntax would look like so: This is just like copying other files around in Terminal. For most Mac users, , but it may be helpful for advanced users to use the command line approach. You can also move a file to iCloud Drive via the command line in Mac OS.

Note that by moving a file to iCloud Drive, it will upload to iCloud Drive but then be removed from where it was originally on the local file system. This is achieved through the simple mv command. Lets take the same example as above and move a file named test.zip from the desktop and move it to iCloud Drive. Again, this file has to upload to the iCloud server so it may take a while to complete the move. For most users, but again the command line approach is helpful to advanced users.


No comments

Powered by Blogger.