keepcalculator

06 Numbers and Powers

Move Files With Permissions on Mac: Paste Item Exactly

Card No. 06·28027 · Updated · Standard formula, shown below

When you copy a file or folder on a Mac and paste it elsewhere, the pasted copy normally inherits the permissions of the destination folder, not the original file. If you need the pasted item to keep its exact permissions, ownership, and extended attributes, the standard Finder paste won’t do it — you need to use the command line or a specialized copy tool. This article explains the built-in methods that preserve permissions exactly, when each is appropriate, and what to do when Finder’s copy changes them.

Why Finder Changes Permissions on Paste

macOS Finder uses the copyfile() API with flags that intentionally reset permissions to the defaults of the destination. This is by design: when you drag a file from one user’s folder to another user’s shared folder, you don’t want the original owner’s permissions to lock out the new location. Finder also strips extended attributes like com.apple.quarantine in some cases, though it preserves others like com.apple.metadata for tags.

The result is that a file copied via Finder shows the destination folder’s owner and group, and its permission bits are typically set to rw-r--r-- for files and rwxr-xr-x for folders, regardless of the source. If you need the original rwx bits, the owner, the group, or ACLs (Access Control Lists) to survive the paste, Finder is not the tool.

What “Exact Permissions� Actually Includes

To preserve permissions exactly, the copy must retain four separate metadata layers:

  • Ownership — the user and group assigned to the item (e.g., alice:staff).
  • POSIX permission bits — the classic rwx triplets for owner, group, and others.
  • Access Control Lists (ACLs) — the extended entries visible with ls -le that allow more granular rules than the basic bits.
  • Extended attributes — metadata like com.apple.quarantine, com.apple.FinderInfo, and resource forks.

Most copy tools, including Finder, handle these differently. The only way to guarantee all four survive is to use a low-level copy that duplicates the inode metadata, which is what ditto and rsync do with specific flags.

Method 1: Use ditto to Preserve Everything

The ditto command is built into macOS and is the simplest way to copy a file or folder while preserving permissions, ownership, ACLs, and extended attributes. It works in the Terminal and does not require any installation.

  1. Open Terminal (in Applications > Utilities).
  2. Use the following syntax, replacing the source and destination paths:
ditto -V /path/to/source /path/to/destination

The -V flag prints each file as it is copied, which is helpful for long copies. Without any flags, ditto already preserves permissions, ownership (if you are the owner or root), ACLs, and extended attributes. If you are copying to a volume that does not support ownership (like a FAT32 drive), the permissions will be lost because the filesystem cannot store them.

One caveat: ditto will overwrite the destination if it already exists, and it does not delete extra files in the destination folder. For a mirror copy that removes files not in the source, use rsync instead.

Method 2: rsync with Archive and Extended Attribute Flags

rsync is more flexible than ditto and is the standard tool for syncing folders while preserving metadata. The key flags are:

  • -a (archive) — preserves permissions, ownership, timestamps, and symbolic links.
  • -E — preserves extended attributes (macOS-specific).
  • -x — preserves ACLs (macOS-specific).

A typical command to copy a folder exactly would be:

rsync -aEx /path/to/source/ /path/to/destination/

Note the trailing slashes: source/ copies the contents of the folder, while source copies the folder itself. If you want the destination to be an exact replica, include the --delete flag to remove files that exist in the destination but not in the source.

If you are copying to a different user’s home directory, you may need sudo to preserve ownership, because only root can change the owner of a file. Running sudo rsync -aEx will ask for your password and then copy with original ownership intact.

Method 3: Use the Finder’s “Copy� with a Workaround

If you must stay in Finder, there is no built-in option to paste with exact permissions. However, you can work around it by duplicating the file within the same folder first, then moving the duplicate. The duplicate created by File > Duplicate (or Command+D) preserves the original permissions because it is a same-volume clone. Then you can drag the duplicate to the new location — but dragging to a different volume or folder will still reset permissions.

For a true “paste exactly� in Finder, you would need a third-party tool like SuperDuper or Carbon Copy Cloner for full volumes, or a Finder extension that calls ditto under the hood. These are not built-in, and for a single file, the Terminal is faster and more reliable.

Common Problems and How to Avoid Them

  • “Operation not permittedâ€� errors — This usually means you are not the owner of the source file or you lack write permission on the destination. Use sudo if you are an administrator.
  • Permissions change after copying to a USB drive — Most external drives formatted as FAT32 or exFAT do not support POSIX ownership. Format the drive as APFS or Mac OS Extended (HFS+) to preserve permissions.
  • Extended attributes are lost — If you use rsync without -E, or ditto without the --rsrc flag (which is default on macOS), you lose quarantine flags and Finder tags. Always include -E for rsync.
  • Copying a folder into itself — If you copy a folder into one of its subfolders, you create an infinite loop. rsync will detect this and refuse; ditto may create a nested copy indefinitely, so check your destination path.

How to Verify Permissions After Copying

To confirm the copy preserved everything, use ls with verbose flags:

ls -le@ /path/to/destination

This shows the permission bits (-l), ACL entries (-e), and extended attributes (@). Compare the output with the source file using the same command. If you see @ after the permissions, extended attributes are present; if you see a +, there are ACLs.

For a quick comparison of just the permission bits, use stat -f "%Sp %Su %Sg" source and the same for the destination. If the output matches, the basic permissions are preserved.

Frequently Asked Questions

Does copy-paste in Finder ever keep permissions?

Yes, when you copy a file within the same volume and paste it into a folder that has the same owner and group as the source, the permissions may appear unchanged. But this is coincidental — Finder still resets them to the destination defaults, which happen to match. If the destination folder has different permissions, the pasted file will adopt those.

Can I preserve permissions when dragging to an external drive?

Only if the external drive is formatted with a filesystem that supports POSIX permissions, such as APFS, Mac OS Extended, or ext4. FAT32 and exFAT do not store Unix permissions, so the files will get default permissions (usually rwxr-xr-x for folders and rw-r--r-- for files). Use ditto or rsync to copy, but the filesystem will still strip what it cannot store.

What is the difference between ditto and rsync for this task?

ditto is simpler and always preserves extended attributes by default, but it does not have an option to delete extraneous files in the destination. rsync offers more control (like --delete, partial transfers, and bandwidth limits) but requires the -E flag to preserve extended attributes and -a for permissions. For a one-time exact copy, ditto is easier; for syncing or scripting, rsync is better.

Why does my pasted file show a different owner?

Finder and most copy tools set the owner to the user performing the copy, not the original owner. To keep the original owner, you must use sudo with ditto or rsync, which runs the copy as root and can preserve ownership. Without root, you cannot assign ownership to another user.

Are there any risks to using sudo with rsync?

Yes, if you mistype the destination path, you could overwrite system files or another user’s data. Always double-check the source and destination paths, and consider using --dry-run first to see what would be copied without actually doing it. Also, be aware that files copied with root ownership may not be accessible to the regular user unless you change ownership afterward.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →