0

On a Mac, is there a way to prevent files in a folder X from being moved by any means (by the Comd+C then Comd+Opt+V on Finder, or by mv command on the command line, or by other apps etc.) to another folder Y, but still allow files to be written/added to the folder X, and still allow files to be copied from the folder X?

If needed, please answer specific to Mac 10.11 to 10.14, and take into account both HFS+ and APFS file systems.

  • 1
    Change the owner/group to root:wheel and set the appropriate ACLs. See man chown and man chmod in Terminal. – user3439894 Jul 17 at 15:37
1

You can use Access Control Lists for this. Run

chmod +a "USERID:deny:delete_child" DIRECTORY

to prevent the user USERID from deleting anything from the directory. To undo, run

chmod -a "USERID:deny:delete_child" DIRECTORY

PS: If you want to have it applied to current and future subfolders beneath DIRECTORY as well, use

"USERID:deny:delete_child,directory_inherit"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .