2

I got a new computer and I didn't want to do a full time machine restore but rather pick and choose what files I was going to copy off of my time machine drive.

So, I went into the directory, found some files I want, and did cp -Rpv dir /Users/username/dir

However, With the -P it kept the same permissions as the files on the time machine. chmod -R 777 dir doesn't work and neither does resetting permissions from within the 'get info' -> 'sharing and permissions' setting.

How can I get the permissions for the directory back to something that will allow me to delete the directory?

2

I've sorted it out. First, you need to look at the ACLs that got copied along with the files.

ls -le /path/to/dir

Once you've done that you can see that everything had this:

0: group:everyone deny write,delete,append,writeattr,writeextattr,chown

So, what I did was add a new ACL policy to the directory by doing this:

chmod -R +a "admin allow read,readattr,readextattr,readsecurity" dir 

Followed by:

sudo rm -rf dir
  • 1
    Welcome to Ask Different! Thanks for coming back to share your solution. This helps to make the site really useful for others. :) – Monomeeth May 10 '17 at 22:23
0

another option:

chmod -R -a "group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown" /path/to/dir

This removes the ACL, rather than adding one. Useful if you intend to keep the files and not delete them.

You must log in to answer this question.

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