commit: 800eaf4f24a72f63d0152337352dc92be2fa410c
parent 3ade2ff3c0d3f603f0b92ba72fc6b2d44a63ac92
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 15 Oct 2024 14:03:43 +0200
cmd/chmod: detail the octal mode
Diffstat:
1 file changed, 29 insertions(+), 5 deletions(-)
diff --git a/cmd/chmod.1 b/cmd/chmod.1
@@ -20,12 +20,15 @@ on each given
.Ar file .
.Pp
.Ar mode
-can be either an octal natural number between 0 and 7777 (ie. 0644 for rw-r--r--), or a symbolic operation, like
-.Ql +r or
-.Ql g=o-x ,
-see
+can be either an octal natural number between 0 and 7777, or a symbolic operation like
+.Ql +r
+or
+.Ql g=o-x .
+See the
+.Sx OCTAL MODE
+and
.Sx SYMBOLIC OPERATIONS
-section for more information.
+sections for details.
.Pp
If
.Ar mode
@@ -43,6 +46,27 @@ Recurse into directories passed to
Verbose, print both changes and retained modes
.Ar file
.El
+.Sh OCTAL MODE
+Octal natural number between 0 and 7777, which can be obtained by or'ing the following values:
+.br
+.Bl -tag -width 0000 -compact
+.It 4000
+setuid
+.It 2000
+setgid
+.It 1000
+sticky bit
+.It 0400
+user read
+.It 0200
+user write
+.It 0100
+user execute/search
+.It 0070
+group read, write, execute/search
+.It 0007
+others read, write, execute/search
+.El
.Sh SYMBOLIC OPERATIONS
Uses the following grammar:
.Bd -literal