macOS 'The operation can’t be completed' error when copying files
This error pops up when copying files to an external drive or shared folder. It's usually a permissions or metadata issue, not a hardware failure.
When this error shows up
You're copying a folder of photos or documents from your Mac to an external drive, a USB stick, or a network share. About halfway through, macOS stops and throws up a dialog: “The operation can’t be completed because an unexpected error occurred (error code -36).” Sometimes it's error -50 or just a generic message. The copy fails, and you're left wondering if your drive is dying.
I've seen this on macOS Ventura, Sonoma, and even Sequoia. It happens most often when the source file has extended attributes (like a quarantine flag or Finder tags) that the target drive doesn't understand. Classic trigger: copying a batch of files downloaded from the internet or imported from a Windows machine.
What's actually causing it
The root cause is almost never a hardware problem. Your drive is probably fine. The real issue is metadata. macOS stores extra info on files—things like the app that opened them, color labels, and “where did this file come from” flags. These live in hidden files like .DS_Store and extended attributes (xattr). When the target filesystem is FAT32, exFAT, or NTFS (like most USB drives), it can't store that metadata. So macOS gets confused and bails.
Another common cause: permissions on the target folder are set to read-only, or the file name contains characters that the target filesystem can't handle (like colons or slashes).
Skip the panic. Don't reformat the drive. Here's how to fix it.
Fix 1: Strip extended attributes from the source files
This is the nuclear option and it works 90% of the time. You'll remove the metadata that's causing the conflict.
- Open Terminal (Finder > Utilities > Terminal).
- Type
xattr -cr /path/to/your/folderand press Return.
Replace/path/to/your/folderwith the actual folder you're trying to copy. For example:xattr -cr /Users/yourname/Desktop/ProjectPhotos.
After you press Return, you won't see any output unless there's an error. That's normal. - Try the copy again. If it works, great—you're done. If not, move to Fix 2.
What that command does: -c removes all extended attributes recursively, and -r goes through every subfolder. It doesn't touch the file contents, just the metadata. Your files will lose Finder tags and the quarantine flag, but they'll copy fine.
Fix 2: Clean up .DS_Store files
Sometimes a corrupted .DS_Store file on the source or target drive is the culprit. This little file stores folder view settings (icon size, sort order). When it gets wonky, macOS trips.
- In Terminal, type
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUEand press Return. This stops macOS from creating new .DS_Store files on network drives. You can skip this if you're copying to a local USB drive. - Delete existing .DS_Store files on both the source and target drives. Run this command in Terminal:
find /path/to/drive -name '.DS_Store' -delete
Replace/path/to/drivewith the drive path. For your external drive, it might be/Volumes/MyUSB. - After the command finishes, eject the drive and reconnect it. Try copying again.
Fix 3: Repair disk permissions on the target drive
If the target drive is APFS or HFS+ (Mac format), permissions might be wrong. Don't bother with Disk Utility First Aid—it rarely fixes permissions for a single folder. Use the command line instead.
- In Terminal, run
diskutil listto see your drives. Find the identifier for your target drive (likedisk2s1). - Mount it if it isn't already:
diskutil mount /dev/disk2s1(replace with your identifier). - Repair permissions with:
sudo diskutil repairPermissions /Volumes/YourDriveName
You'll be asked for your admin password. After you type it, the command runs and shows progress. It can take a few minutes.
Note: On macOS High Sierra and later, repairPermissions only works on the system volume, not external drives. If you're on a modern macOS, skip this fix and use the Get Info method below.
Fix 4: Change permissions on the target folder using Finder
This is the manual way to give yourself write access to the target folder.
- In Finder, right-click the destination folder (the one you're copying into on the external drive).
- Select Get Info.
- At the bottom of the Info window, look for Sharing & Permissions. If you don't see it, click the arrow next to it to expand.
- If the lock icon is locked, click it and enter your admin password.
- Next to your username (or “everyone”), change the privilege from Read only to Read & Write.
- Click the gear icon and select Apply to enclosed items. This changes permissions for all files and subfolders inside.
- Wait for the progress bar to finish. Then try your copy again.
Fix 5: Rename the file or folder you're copying
Sometimes the file name is the problem. macOS can't handle certain characters on non-Apple filesystems. Look for colons (:), slashes (/), or control characters in the name. Also check if the file name ends with a period (.). Windows and Linux drives reject that.
- In Finder, click the file name once to select it, then pause. Click it again to make the name editable.
- Rename it to something simple like
Export_v2(no special characters, no leading/trailing spaces). - Try copying again.
What to check if it still fails
If you've tried all five fixes and the error still shows up, here's what to look at next:
- Drive format: The target drive might be formatted as FAT32, which has a 4GB file size limit. If your file is larger than 4GB, the copy will fail. Check the drive format in Disk Utility. If it's FAT32 and you need big files, reformat to exFAT (which supports files up to 16EB).
- Bad sectors: Run Disk Utility First Aid on both the source and target drives. If it finds errors, you might have a failing drive. Back up immediately.
- Network share: If you're copying to a network drive (SMB or AFP), try connecting via the Finder's Connect to Server command (Command+K) and using
smb://orafp://directly. Sometimes the automatic network mount adds permissions restrictions. - Corrupted file: One file in the batch might be corrupt. Try copying files one at a time to find the bad one. When you find it, delete it or recreate it from the original source.
I've fixed hundreds of these errors over the years. Fix 1 and Fix 4 together solve almost every case. Don't waste time reformatting or buying a new drive. The problem is almost always software, not hardware.
Was this solution helpful?