bug#80949: [PATCH] chmod: clarify mode specification and add usage examples
Alisha Panda <[email protected]> Sat, 2 May 2026 16:18:57 +0530
| Newsgroups | gmane.comp.gnu.core-utils.bugs |
|---|---|
| Message-ID | <CABhtPNKvRzC_LD-6-d+Mky7enr4eFn+M0Ejw+0iLJE9f5bBbZg@mail.gmail.com> |
Hello, This patch improves the chmod manual page by clarifying the difference between numeric and symbolic modes and by adding practical usage examples. These changes aim to make the documentation more accessible for new users while preserving existing information. Thank you for your time. Regards, Alisha Panda
0001-chmod-clarify-mode-specification-and-add-usage-examp.patch
(application/octet-stream, 1.8 KB)
From 57fce5e27522bde30cc191e9b2a779c32b44e3e1 Mon Sep 17 00:00:00 2001 From: ALISHA <[email protected]> Date: Sat, 2 May 2026 16:02:37 +0530 Subject: [PATCH] chmod: clarify mode specification and add usage examples --- man/chmod.x | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/man/chmod.x b/man/chmod.x index 39749f0bf..1f332f35e 100644 --- a/man/chmod.x +++ b/man/chmod.x @@ -15,6 +15,18 @@ changes the file mode bits of each given file according to which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits. .PP +Modes may be specified in numeric (octal) form or symbolic form. + +The numeric form uses three octal digits representing permissions for +the owner, group, and others, respectively. For example, a mode of 755 +grants read, write, and execute permissions to the owner, and +read and execute permissions to group members and others. + +The symbolic form uses combinations of the letters \fBu\fP, \fBg\fP, +\fBo\fP, and \fBa\fP to represent the user, group, others, and all +users, respectively, together with operators such as \fB+\fP, +\fB-\fP, and \fB=\fP. + The format of a symbolic mode is [\c \fBugoa\fP.\|.\|.][[\fB-+=\fP][\fIperms\fP.\|.\|.].\|.\|.], where @@ -118,3 +130,26 @@ quickly when run; this is called the .SH OPTIONS [SEE ALSO] chmod(2) + +.SH EXAMPLES +.PP +Set read, write, and execute permissions for the owner, and +read and execute permissions for group and others: + + chmod 755 file.sh + +Allow only the owner to read and write a file: + + chmod 600 secret.txt + +Add execute permission for the owner: + + chmod u+x script.sh + +Remove write permission for group and others: + + chmod go-w file.txt + +Recursively set permissions on a directory: + + chmod -R 700 mydir -- 2.51.0