CHMOD(1)
π CHMOD(1) β like, the Perl one, bestie β¨
Hey so this is chmod(1) from the User Contributed Perl Documentation fam β not the GNU one, not the OpenBSD one, this specific Perl implementation, okay? iykyk π«Ά
πΈ NAME πΈ
chmod β change permissions of files. that's it, that's the vibe. π
π¦ SYNOPSIS π¦
chmod [-R [-H | -L | -P]] mode file...
literally just options, then a mode, then the files. slay.
π DESCRIPTION π
okay so chmod sets the permissions of files. and like, the first argument after the options? that's the permission the files should be given. main character argument energy fr. β¨
π OPTIONS π
chmod accepts the options described below, bestie. the -L, -H and -P options are mutually exclusive, and only the last one you give will be honoured β so pick a lane. π and all of -L, -H and -P require the -R option to be set first. no -R, no deal.
-Rβ recurse into directories. any directories are recursively traversed, and all files and directories will change owner. go off, get recursive. π₯-Lβ follow symbolic links. by default,chmodwill not follow symbolic links. > bestie this is a potentially dangerous option, becausechmodwill not check for cycles. be careful. π this option requires the-Roption to be set.-Hβ follow symbolic links of command line files/directories only. this option requires the-Roption to be set.-Pβ do not follow symbolic links at all. this option requires the-Roption to be set.
π MODES π
so modes are either absolute or symbolic, and honestly both have their moment.
an absolute mode is an octal number, calculated by OR-ing the following values together β ngl this is the part you screenshot:
4000β suid on execution.2000β guid on execution.1000β thesticky(8)bit is turned on.0400β read permission for the owner of the file.0200β write permission for the owner of the file.0100β execute permission for the owner of the file.0040β read permission for those in the group as the group of the file.0020β write permission for those in the group as the group of the file.0010β execute permission for those in the group as the group of the file.0004β read permission for all others.0002β write permission for all others.0001β execute permission for all others.
symbolic mode is a comma separated list of actions, and each action has this exact format:
[who] operator [permissions] [operator [permissions] ...]
π§ who π§
who consists of zero or more of the following symbols:
uβ permissions for the user (owner) of the file.gβ permissions for the group of the file.oβ permissions for all others.aβ permissions for everyone.
if who is omitted, it will default to a, but the value of your umask is taken into account. chmod will then not set a permission that is masked by your umask. respect the umask, it's giving boundaries. π
β the operator β
the operator is one of:
+β add permissions. if no permissions are given, this action is ignored. ifwhois absent, set the permission bit as indicated by permissions, but respect the umask settings. ifwhois given, set the permission bits as indicated by permissions, for those groups indicated bywho.-β revoke permissions. if no permissions are given, this action is ignored. ifwhois absent, revoke the permission bit as indicated by permissions, but respect the umask settings. ifwhois given, revoke the permission bits as indicated by permissions, for those groups indicated bywho.=β set permissions. the permission bits indicated bywhoare all cleared. ifwhoisn't given, all permission bits are cleared. then, ifwhoisn't given, those permission bits in permission whose corresponding bit in the umask is clear are set. otherwise, the permission bits are set as indicated bywhoand permission.
π permission π
permission consists of zero or more of:
rβ the read permission bit.wβ the write permission bit.xβ the execute permission bit.Xβ the execute permission bit, but only if the target is either a directory, or has at least one execution bit set in the unmodified permission bits. furthermore, this permission is ignored if operator is either-or=.sβ the suid and guid bit. these will have no effect in combination with theowhosetting.tβ the sticky bit. this makes sense only for the others group, however, it will be ignored ifois the only group in thewhopart of the clause.uβ the original permissions of the user.gβ the original permissions of the group.oβ the original permissions for others.
πΌ ENVIRONMENT πΌ
the working of chmod is not influenced by any environment variables. nothing. zero. the environment could never. π
π BUGS π
okay bestie, buckle up, this section ate:
it is unlikely there are no bugs. the documentation is at best ambiguous. the OpenBSD documentation does not match the OpenBSD implementation. furthermore, the implementations of Solaris, SunOS, HP, and GNU all differ from each other, and from OpenBSD. chaos fr fr. π
this manual page needs work. the module PerlPowerTools::SymbolicMode needs to be documented.
chmod parses a symbolic mode once for each file. that is too much redundant work.
π¨ chmod can loop forever when symbolic links create cycles. not a vibe.
chmod uses File::Find to recurse.
this manual should have been written in Texinfo, LaTeX, or a funky SGML application. pod2man, pod2html, pod2text and pod2latex are all broken beyond belief. π
π STANDARDS π
it does not make sense to talk about standards in a chmod manual page. periodt. π
π REVISION HISTORY π
look at this lore, it's literally archaeology:
$Log: chmod,v $
Revision 1.2 2004/08/05 14:17:43 cwest
cleanup, new version number on website
Revision 1.1 2004/07/23 20:10:01 cwest
initial import
Revision 1.3 1999/03/09 02:44:57 abigail
Fixed SybolicMode -> SymbolicMode typo.
Revision 1.2 1999/03/08 03:07:28 abigail
Major documentation tweaks.
Revision 1.1 1999/03/07 12:03:54 abigail
Initial revision
π AUTHOR π
the Perl implementation of chmod was written by Abigail, perlpowertools@abigail.be. iconic behavior honestly. π«Ά
β¨ COPYRIGHT and LICENSE β¨
this program is copyright by Abigail 1999.
this program is free and open software. you may use, copy, modify, distribute, and sell this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same. share the love, bestie. π
and that's the whole page!! documented by the Perl crew, version perl v5.42.2, dated 2026-02-15 β so yeah, go chmod responsibly, and remember: with great -R comes great responsibility. bye bestie!! π¦β¨π
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms