setting default directory ACLs using xargs

perryh at perryh at
Sat Feb 13 09:31:47 UTC 2010

Doug Sampson <dougs at> wrote:

> I need to do this at the command prompt for all directories:
> root at aries:/data/Products# getfacl . | setfacl -d -b -n -M - .

> Now, I have thousands of subdirectories that I want to apply this
> to. When I attempt to use the xarg command with the above command
> modified to work with xargs, I end up with an error message ...

Two possibilities come to mind:

* Try using the "-L 1" switch to cause xargs to run a separate
  command instance for each input value.

* You may have run into one of the rare situations where
  "find ... | xargs" is not the best tool for the job.  It may
  work better to set up a 3-line shell script along the lines of

    cd $1
    getfacl . | setfacl -d -b -n -M - .

  and then use "find -type d -exec" to run it for each directory.

More information about the freebsd-questions mailing list