Sub topic 9
Keeping files offline or removing local copies
This chapter covers the two Finder commands that control where a file's data lives on your Mac: Keep Downloaded and Remove Download. It assumes you have already turned on iCloud Drive, you can find your files in Finder, and you know what Optimize Mac Storage does. It also assumes you can recognize the cloud and progress icons from the previous chapter.
The problem these commands solve
With Optimize Mac Storage on, macOS decides which iCloud Drive files stay on disk. When free space runs low, it replaces the contents of files you haven't used recently with small placeholders. The file keeps its name, size, and place in the folder. Its data now lives only in iCloud.
That automatic choice has two weak points:
- A file you need on a flight may be a placeholder when you board.
- A large file you finished with months ago may sit on your disk until the Mac decides it needs the space.
Keep Downloaded and Remove Download let you override the automatic choice for specific files and folders.
The three local states
A file in iCloud Drive is in one of three states on your Mac.
| State | Data on this Mac | Who decides | Works offline |
|---|---|---|---|
| Downloaded | Yes | macOS, and it may later remove the data to free space | Yes, until macOS removes it |
| Cloud only | No, only a placeholder | macOS or you (Remove Download) | No |
| Kept downloaded | Yes | You (Keep Downloaded) | Yes |
Opening a cloud-only file moves it to Downloaded. Keep Downloaded moves it to the third state, which macOS leaves alone. Remove Download moves a file back to cloud only.
Keeping files offline
To make files available without a connection:
- Open Finder and select iCloud Drive in the sidebar.
- Select one or more files or folders.
- Control-click the selection (or right-click it) and choose Keep Downloaded.
If a file was cloud only, the Mac starts downloading it and shows a progress indicator. When the download finishes, the file is stored locally. macOS will not reclaim its space automatically, even when the disk is nearly full.
You can apply the command to a folder. Check the result afterward: Finder's status icons show whether the contents downloaded. Newer versions of macOS also mark kept items with their own icon, so you can tell them apart from files that are merely downloaded. If you rely on a folder staying available offline, open a few files inside it with Wi-Fi off before you travel.
Keep Downloaded is a good fit for:
- Documents you need on a flight or in a place with poor reception.
- Reference material you open daily, where a re-download delay would be annoying.
- Files that other apps read in the background, such as a project folder your editor indexes.
Removing local copies
To free disk space on purpose:
- Select the files or folders in iCloud Drive.
- Control-click and choose Remove Download.
The Mac deletes the local data and leaves a placeholder. The file still appears in Finder, still syncs, and still exists on your other devices and at iCloud.com. Remove Download is not Delete. If you choose Move to Trash, the deletion syncs to every device.
Remove Download works on a folder as well, which is the quickest way to reclaim space from an archive you rarely touch. It is also the way to undo Keep Downloaded. Remove the download, and the file goes back to being managed automatically.
Remove Download only succeeds when iCloud holds a complete copy. A file that is still uploading or has unsynced changes stays on disk until the upload finishes. Wait for the progress indicator to clear, then try again.
What happens when something reads a placeholder
A cloud-only file is not an error. When an app opens it, macOS downloads the data first, and the app proceeds once the data arrives. On a fast connection you may barely notice. On a slow or missing connection, the open command waits or fails.
This matters beyond Finder:
- Command-line tools. A script that reads a placeholder triggers a download. A command that walks a large folder, such as
grep -r, can trigger hundreds of downloads at once. - Backups and copies. Copying a cloud-only folder to an external drive downloads every file in it first. Check your free space before you copy it.
- Search and previews. Quick Look and Spotlight can show previews and metadata without downloading the whole file. Features that need the full contents do trigger a download.
Controlling downloads from Terminal
The Terminal can show and change the same state. Your iCloud Drive folder is ~/Library/Mobile Documents/com~apple~CloudDocs. On current macOS versions, a cloud-only file appears under its normal name, and ls -lO shows a dataless flag for it.
ICLOUD="$HOME/Library/Mobile Documents/com~apple~CloudDocs"
# Show file flags. Cloud-only files list "dataless".
ls -lO "$ICLOUD"
# Download one file's data now.
brctl download "$ICLOUD/archive.zip"
# Remove the local data but keep the file in iCloud.
brctl evict "$ICLOUD/archive.zip"brctl ships with macOS but has little official documentation, so its options can change between releases. Treat the Finder commands as the supported way to work, and use brctl for scripting or for working over SSH. Run brctl help to see what your version offers.
Choosing between automatic and manual control
| Situation | Suggested action |
|---|---|
| Large, rarely used archive | Remove Download, and leave it cloud only |
| Files for travel or poor connections | Keep Downloaded before you leave |
| Disk nearly full, and you cannot tell why | Check the Storage settings, then Remove Download on large folders |
| Folder read by a build tool or indexer | Keep Downloaded, or exclude the folder with `.nosync` if it should not sync at all |
| A file you will never need again | Move to Trash, which deletes it everywhere |
Keep Downloaded and Optimize Mac Storage can work together. Optimize Mac Storage handles the bulk of your files, and you pin the small set that must always be there. Turning Optimize Mac Storage off makes every iCloud Drive file download in full. That is simple, but it only works if your disk can hold everything in your iCloud plan.
Common errors and how to read them
- A file you kept is cloud only again. The Keep Downloaded setting may have been cleared, for example by replacing the file with a new copy. Apply Keep Downloaded again and confirm the icon.
- Remove Download does not free any space. The file may be uploading, or your disk usage may come from somewhere else, such as local snapshots. Check the Storage settings to see what is using the space.
- A file will not open offline. It was cloud only when you lost the connection. Keep important files downloaded before you travel.
- The folder is huge after a copy or backup. The tool downloaded every placeholder. Use Remove Download on the folder afterward, once the copy is complete.
Summary
Keep Downloaded pins a file's data to your Mac. Remove Download releases it and leaves a placeholder. Neither command changes the file in iCloud or on your other devices. Only Move to Trash deletes the file everywhere.
Exercise
You are about to fly for six hours and need a folder of iCloud Drive documents on your MacBook. The disk is nearly full, and Optimize Mac Storage is on. What do you do before you leave, and how do you confirm it worked?
Show answer
Select the folder in iCloud Drive in Finder, Control-click it, and choose Keep Downloaded. Wait for the download progress to finish. Because macOS does not reclaim space from kept files, the data stays on disk even when space runs low. To confirm, check that the status icons show the files as downloaded (not the cloud icon), then open a few of them with Wi-Fi turned off.
Exercise
A teammate says that choosing Remove Download on a project folder deletes it from their iPhone as well. Is that right? Which action does delete the files everywhere?
Show answer
No. Remove Download only deletes the local data on that Mac and leaves a placeholder. The files stay in iCloud and on the other devices. Move to Trash deletes the files, and that deletion syncs to every device signed in to the same Apple Account.
Exercise
A script that runs grep -r on a cloud-only folder is slow and fills your disk. Why, and what can you do?
Show answer
Reading a placeholder makes macOS download the file's data, so the search downloads every file in the folder. Either Remove Download on the folder after the search, or narrow the search to the files you need. If the folder should never sync, such as node_modules, exclude it with the .nosync suffix.