[-?
@(#)$Id: chmod (AT&T Research) 2012-04-20 $
]
[+NAME?chmod - change the access permissions of files]
[+DESCRIPTION?\bchmod\b changes the permission of each file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new permissions.]
[+?Symbolic mode strings consist of one or more comma separated list of operations that can be performed on the mode. Each operation is of the form \auser\a \aop\a \aperm\a where \auser\a is zero or more of the following letters:]{
[+u?User permission bits.]
[+g?Group permission bits.]
[+o?Other permission bits.]
[+a?All permission bits. This is the default if none are specified.]
}
[+?The \aperm\a portion consists of zero or more of the following letters:]{
[+r?Read permission.]
[+s?Setuid when \bu\b is selected for \awho\a and setgid when \bg\b is selected for \awho\a.]
[+w?Write permission.]
[+x?Execute permission for files, search permission for directories.]
[+X?Same as \bx\b except that it is ignored for files that do not already have at least one \bx\b bit set.]
[+l?Exclusive lock bit on systems that support it. Group execute must be off.]
[+t?Sticky bit on systems that support it.]
}
[+?The \aop\a portion consists of one or more of the following characters:]{
[++?Cause the permission selected to be added to the existing permissions. | is equivalent to +.]
[+-?Cause the permission selected to be removed to the existing permissions.]
[+=?Cause the permission to be set to the given permissions.]
[+&?Cause the permission selected to be \aand\aed with the existing permissions.]
[+^?Cause the permission selected to be propagated to more restrictive groups.]
}
[+?Symbolic modes with the \auser\a portion omitted are subject to \bumask\b(2) settings unless the \b=\b \aop\a or the \b--ignore-umask\b option is specified.]
[+?A numeric mode is from one to four octal digits (0-7), derived by adding up the bits with values 4, 2, and 1. Any omitted digits are assumed to be leading zeros. The first digit selects the set user ID (4) and set group ID (2) and save text image (1) attributes. The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1); the third selects permissions for other users in the file's group, with the same values; and the fourth for other users not in the file's group, with the same values.]
[+?For symbolic links, by default, \bchmod\b changes the mode on the file referenced by the symbolic link, not on the symbolic link itself. The \b-h\b options can be specified to change the mode of the link. When traversing directories with \b-R\b, \bchmod\b either follows symbolic links or does not follow symbolic links, based on the options \b-H\b, \b-L\b, and \b-P\b.]
[+?When the \b-c\b or \b-v\b options are specified, change notifications are written to standard output using the format, \b%s: mode changed to %0.4o (%s)\b, with arguments of the pathname, the numeric mode, and the resulting permission bits as would be displayed by the \bls\b command.]
[+?For backwards compatibility, if an invalid option is given that is a valid symbolic mode specification, \bchmod\b treats this as a mode specification rather than as an option specification.]
[H:metaphysical?Follow symbolic links for command arguments; otherwise don't follow symbolic links when traversing directories.]
[L:logical|follow?Follow symbolic links when traversing directories.]
[P:physical|nofollow?Don't follow symbolic links when traversing directories.]
[R:recursive?Change the mode for files in subdirectories recursively.]
[c:changes?Describe only files whose permission actually change.]
[f:quiet|silent?Do not report files whose permissioins fail to change.]
[h|l:symlink?Change the mode of symbolic links on systems that support \blchmod\b(2). Implies \b--physical\b.]
[i:ignore-umask?Ignore the \bumask\b(2) value in symbolic mode expressions. This is probably how you expect \bchmod\b to work.]
[n:show?Show actions but do not change any file modes.]
[F:reference?Omit the \amode\a operand and use the mode of \afile\a instead.]:[file]
[v:verbose?Describe changed permissions of all files.]

mode file ...

[+EXIT STATUS?]{
[+0?All files changed successfully.]
[+>0?Unable to change mode of one or more files.]
}
[+SEE ALSO?\bchgrp\b(1), \bchown\b(1), \blchmod\b(1), \btw\b(1), \bgetconf\b(1), \bls\b(1), \bumask\b(2)]
