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/
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.
mv ~/Desktop/filename.zip ~/Library/Mobile\ Documents/com~apple~CloudDocs/
This command works for both files and folders.
Discussion