|CHMOD ( 1 )||USER COMMANDS||CHMOD ( 1 )|
Symbolic mode strings consist of one or more comma separated list of operations that can be perfomed on the mode. Each operation is of the form user op perm where user is zero or more of the following letters:
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 permissionsfor 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, chmod changes the mode on the file referenced by the symbolic link, not on the symbolic link itself. The -h options can be specified to change the mode of the link. When traversing directories with -R, chmod either follows symbolic links or does not follow symbolic links, based on the options -H, -L, and -P. The configuration parameter PATH_RESOLVE determines the default behavior if none of these options is specified.
When the -c or -v options are specified, change notifications are written to standard output using the format, %s: mode changed to %0.4o (%s), with arguments of the pathname, the numeric mode, and the resulting permission bits as would be displayed by the ls command.
For backwards compatibility, if an invalid option is given that is a valid symbolic mode specification, chmod treats this as a mode specification rather than as an option specification.