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:

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]

Leave a Reply

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