.TH CHMOD 1 "18 January 1983"
\fBchmod\fP mode file ...
The mode of each named file is changed according to \fImode\fP,
which may be absolute or symbolic. An absolute \fImode\fP
is an octal number constructed from the OR of the following modes:
set group ID on execution
execute (search in directory) by owner
read, write, execute (search) by group
read, write, execute (search) by others
A symbolic \fImode\fP has the form:
.RI [ "op permission" "] ..."
The \fIwho\fP part is a combination of the letters \fBu\fP
(for user's permissions), \fBg\fP (group) and \fBo\fP (other).
The letter \fBa\fP stands for all, or \fBugo.\fP
If \fIwho\fP is omitted, the default is \fIa\fP
but the setting of the file creation mask (see umask(2)) is taken into account.
\fIOp\fP can be \fB+\fP to add \fIpermission\fP to the file's mode,
\fB\-\fP to take away \fIpermission\fP and \fB=\fP to assign
\fIpermission\fP absolutely (all other bits will be reset).
\fIPermission\fP is any combination of the letters \fBr\fP (read),
\fBw\fP (write), \fBx\fP (execute), \fBs\fP (set owner or group id)
and \fBt\fP (save text \- sticky). Letters
\fBg\fP or \fBo\fP indicate that \fIpermission\fP
is to be taken from the current mode. Omitting \fIpermission\fP
is only useful with \fB=\fP to take away all permissions.
The first example denies write permission to others,
the second makes a file executable:
Multiple symbolic modes separated by commas may be given.
Operations are performed in the order specified. The letter
\fBs\fP is only useful with \fBu\fP or \fBg.\fP
Only the owner of a file (or the super-user) may change its mode.
ls(1), chmod(2), stat(2), umask(2), chown(8)