A symbolic mode has the form:
[who] op permission [op permission] ...
The who part is a combination of the letters u (for user's permissions), g (group) and o (other). The letter a stands for all, or ugo. If who is omitted, the default is a but the setting of the file creation mask (see umask(2)) is taken into account.
Op can be + to add permission to the file's mode, - to take away permission and = to assign permission absolutely (all other bits will be reset).
Permission is any combination of the letters r (read), w (write), x (execute), X (set execute only if file is a directory or some other execute bit is set), s (set owner or group id) and t (save text - sticky). Letters u, g, or o indicate that permission is to be taken from the current mode. Omitting permission is only useful with = to take away all permissions.
When the -R option is given, chmod recursively descends its directory arguments setting the mode for each file as described above. When symbolic links are encountered, their mode is not changed and they are not traversed.
If the -f option is given, chmod will not complain if it fails to change the mode on a file.
The first example denies write permission to others, the second makes a file executable by all if it is executable by anyone:
chmod o-w file
chmod +X file
Multiple symbolic modes separated by commas may be given. Operations are performed in the order specified. The letter s is only useful with u or g.
Only the owner of a file (or the super-user) may change its mode.
Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97