System Administration Guide, Volume 2

How to Copy an ACL

Copy a file's ACL to another file by redirecting the getfacl output.


$ getfacl filename1 | setfacl -f - filename2

filename1

Specifies the file from which to copy the ACL. 

filename2

Specifies the file on which to set the copied ACL. 

Example--Copying an ACL

The following example copies the ACL on ch2.doc to ch3.doc.


$ getfacl ch2.doc | setfacl -f - ch3.doc