CHMOD(1) COMMAND REFERENCE CHMOD(1) NAME chmod - change mode of file or directory SYNOPSIS chmod mode filename... DESCRIPTION The mode of each named file is changed according to mode, which may be absolute or symbolic. Note that the examples given below for group and other permissions are simply the sum of the settings for read, write and execute given in the owner examples. An absolute mode is an octal number constructed from the OR of the following modes: 4000 set user ID on execution 2000 set group ID on execution 1000 sticky bit, see chmod(2) 0400 read by owner 0200 write by owner 0100 execute (search in directory) by owner 0070 read, write, execute (search) by group 0007 read, write, execute (search) by others 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, - (a minus sign) to take away permission, and = (an equal sign) to assign permission absolutely (all other bits will be reset). Permission is any combination of the letters r (read), w (write), x (execute), 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. Multiple symbolic modes separated by commas may be given. Operations are performed in the order specified. The letter Printed 5/12/88 1
CHMOD(1) COMMAND REFERENCE CHMOD(1) s is only useful with u or g. Only the owner of a file (or the superuser) may change its mode. EXAMPLES The first example denies write permission to others; the second makes a file executable: chmod o-w file chmod +x file This example uses the permissions that are on for the group and turns them on for the user and others: chmod uo+g RETURN VALUE [NO_ERRS] Command completed without error. [USAGE] Incorrect command line syntax. Execution terminated. [NP_ERR] An error occurred that was not a system error. Execution terminated. [P_WARN] A system error occurred. Execution continues. See intro(2) for more information on system errors. SEE ALSO ls(1), chmod(2), stat(2), and umask(2), Printed 5/12/88 2
%%index%% na:264,92; sy:356,192; de:548,2277;3161,152; ex:3313,375; rv:3688,553; se:4241,184; %%index%%000000000117