macOS: How to Access iCloud Drive in Terminal


Page 2 – Copying and Moving Files and Folders

Copy Folders

Copying a folder (a.k.a. a directory) is similar to the copy file command, except we need to add the -a option:

cp -a ~/Desktop/foldername ~/Library/Mobile\ Documents/com~apple~CloudDocs/
Copying a folder to access iCloud Drive in Terminal.
Copying a folder/directory

Moving Files and Folders

Instead of copying, you can move a file to change its location:

Don’t miss the best of The Mac Observer

Set us as a preferred source and our Apple reporting ranks higher in your Google Search results and Discover feed — one tap, no account changes.

Or get it by email
mv ~/Desktop/filename.zip ~/Library/Mobile\ Documents/com~apple~CloudDocs/

This command works for both files and folders.

[macOS: How to Find Network Devices Using Terminal]

Discussion

Join the discussionCommenting as a guest — your email is never published · Log in

Protected by Akismet — be kind, stay on topic.

This site uses Akismet to reduce spam. Learn how your comment data is processed.