CHACL(1)
π CHACL β the ACL glow-up command
okay bestie, so this is chacl, from section 1 of the manual (the Access Control Lists corner of the man pages, if you will). It changes the access control list of a file or directory. Yes, that ACL. The permission system's cooler older cousin. Let's get into it π
β¨ NAME β¨
chacl β change the access control list of a file or directory. literally that's her whole job π
π¦ SYNOPSIS π¦
chacl acl pathname...
chacl -b acl dacl pathname...
chacl -d dacl pathname...
chacl -R pathname...
chacl -D pathname...
chacl -B pathname...
chacl -l pathname...
chacl -r pathname...
πΈ DESCRIPTION πΈ
So. chacl is an IRIX-compatibility command, and she's kept alive for the girlies who already know her from either XFS or IRIX. If you want tools that conform more closely to the (withdrawn draft) POSIX 1003.1e standard β the one that actually describes Access Control Lists (ACLs) β scroll your cute self down to the SEE ALSO section below, okay? π«Ά
chacl changes the ACL(s) for a file or directory. The ACL(s) you specify get applied to each file in the pathname arguments. Every single one. She does not play favorites π
Each ACL is a string, and it gets interpreted using the acl_from_text(3) routine. These strings are made up of comma separated clauses, each one looking like this:
tag:name:perm
And tag can be any of these icons:
"user"(or"u") β indicating that the entry is a "user" ACL entry."group"(or"g") β indicating that the entry is a "group" ACL entry."other"(or"o") β indicating that the entry is an "other" ACL entry."mask"(or"m") β indicating that the entry is a "mask" ACL entry.
name is a string, and it's the user or group name for the ACL entry. And here's the tea: a null name in a user or group ACL entry means the file's owner or the file's group, no cap.
perm is the string "rwx", where each of the entries may be replaced by a "-" indicating no access of that type, e.g. "r-x", "--x", "---". It's giving permission bingo π
π OPTIONS π
-bβ Indicates that there are two ACLs to change: the first is the file access ACL and the second is the directory default ACL. Two for the price of one, iconic.-dβ Used to set only the default ACL of a directory.-Rβ Removes the file access ACL only.-Dβ Removes the directory default ACL only.-Bβ Remove all ACLs. Everything. Gone. Bye π-lβ Lists the access ACL and possibly the default ACL associated with the specified files or directories. Heads up bestie: this option was added during the Linux port of XFS, and it is not IRIX compatible.-rβ Set the access ACL recursively for each subtree rooted atpathname(s). Same disclaimer: this one was also added during the Linux port of XFS, and it's not compatible with IRIX either.
π EXAMPLES π
A minimum ACL, the little baby starter ACL:
chacl u::rwx,g::r-x,o::r-- file
The file ACL is set so that the file's owner has "rwx", the file's group has read and execute, and others have read only access to the file. Simple, clean, slay β¨
An ACL that is not a minimum ACL β meaning one that specifies a user or group other than the file's owner or owner's group β must contain a mask entry:
chacl u::rwx,g::r-x,o::r--,u:bob:r--,m::r-x file1 file2
And if you want to set the default and access ACLs on newdir to be the same as on olddir, you could type:
chacl -b `chacl -l olddir | \
sed -e 's/.*\[//' -e 's#/# #' -e 's/]$//'` newdir
The way that backtick-command-substitution-sed-pipeline ate, honestly π₯
π¨ CAUTIONS π¨
chaclcan replace the existing ACL. Like, fully replace it. If you want to add or delete entries, you must first dochacl -lto get the existing ACL, and use the output to form the arguments tochacl. Do not skip this step, I am begging you π
Changing the permission bits of a file will change the file access ACL settings (see chmod(1)). However, file creation mode masks (see umask(1)) will not affect the access ACL settings of files created using directory default ACLs. Two very different vibes, don't mix them up π
ACLs are filesystem extended attributes and hence are not typically archived or restored using the conventional archiving utilities. See attr(5) for more information about extended attributes, and see xfsdump(8) for a method of backing them up under XFS. Back up your ACLs, bestie, future you will thank present you π
π SEE ALSO π
getfacl(1), setfacl(1), chmod(1), umask(1), acl_from_text(3), acl(5), xfsdump(8)
okay that's the whole page!! π¦ this little gem comes from the ACL File Utilities β page dated September 2001 β and honestly she's still out here doing her thing. go forth and ACL responsibly, bestie. mwah ππβ¨
π¦ where this page comes from
- alpine 3.22: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- alpine 3.23: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- alpine 3.24: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- arch rolling: acl 2.4.0-1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- centos-stream 10: acl 2.4.0-2.el10 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 9: acl 2.4.0-2.el9 Β· GPLv2+
- debian bookworm: acl 2.3.1-3
- debian trixie: acl 2.3.2-2+b1
- fedora 43: acl 2.3.2-4.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: acl 2.4.0-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: acl 2.3.2-6.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: acl 2.4.0-1.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- nixpkgs unstable: acl 2.4.0
- opensuse-leap 16.0: acl 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: acl 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: acl 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: acl 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu jammy: acl 2.3.1-1
- ubuntu noble: acl 2.3.2-1build1
- ubuntu noble: acl 2.3.2-1build1.1
- ubuntu resolute: acl 2.3.2-2
- ubuntu stonking: acl 2.4.0-1
- Copyright (C) 2001, 2002, 2004 Silicon Graphics, Inc. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms