other::---
8.3.1.2. Copying and moving files with their ACLs
To copy an ACL when copying a file, use the -p argument to cp :
$ getfacl
# file: demo
# owner: chris
# group: chris
user::rw-
group::rw- #effective:r--
mask::r--
other::---
$ cp -p
$ getfacl
# file: demo2
# owner: chris
# group: chris
user::rw-
group::rw- #effective:r--
mask::r--
other::---
When moving a file (with mv ), the ACL is automatically preserved:
$ mv
$ getfacl
# file: demo3
# owner: chris
# group: chris
user::rw-
group::rw- #effective:r--
mask::r--
other::---
8.3.1.3. Copying an ACL from one file to another
It can be a lot of work setting up a complex ACL with many entries. To simplify the reuse of ACLs,
$ getfacl
$ setfacl --set-file
$ getfacl
# file: bar
# owner: chris
# group: chris
user::rw-
user:thomas:r--
user:diane:r--
user:gord:rw-
user:jim:rw-
group::rw-
mask::rw-
other::---
Since --set-file accepts the filename - for standard input, you can also pipe the output of
$ getfacl
8.3.1.4. Improving the appearance of ACL listings
$ getfacl
# file: bar
# owner: chris
# group: chris
user::rw-
user:thomas:r--
user:diane:r--
user:gord:rw- #effective:r--
user:jim:rw- #effective:r--
group::rw- #effective:r--
mask::r--
other::---
$ getfacl --tabular
# file: bar
USER chris rw-
user thomas r--
user diane r--
user gord rW-
user jim rW-
GROUP chris rW-