Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a directory with the following default ACLs:

default:user:phptutor:rwx

However, none of the files/directories in that directory have that default permission (because it was added after they were created).

How can I copy the default ACLs of a parent directory to every folder and file in it?

share|improve this question
up vote 11 down vote accepted

Use getfacl to get the default permissions from the directory and then pipe the result into setfacl to apply it. Something like this should work:

getfacl -d <directory> | setfacl -R --set-file=- <directory>
share|improve this answer
    
Thanks, Tom! That worked incredibly well! – hopeseekr Jul 1 '11 at 12:29
    
Thanks again, @TomH! I've been using this nifty trick for 5 years exactly now!! And today, my question just got the Nice Question badge. Woohoo! – hopeseekr May 22 at 22:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.