CHMOD(1) CHMOD(1) NAME chmod - change mode SYNOPSIS chmod mode file ... DESCRIPTION The mode of each named file is changed according to mode, which may be absolute or symbolic. An absolute mode is an octal number constructed from the OR of the following modes. (Modes that contain a 1000 bit are incompatible with other modes that have any bits among 7000.) 4000 set user ID on execution 3000 set exclusive access mode (1 writer or n readers) 2000 set group ID on execution 1000 set synchronized access mode (1 writer and n readers) 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 ugo. If who is omitted, the default is a. 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), s (set owner or group id) e (set exclusive access mode) and y (set synchronized access mode). 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 s is only useful with u or g. Only the owner of a file (or the super-user) may change its mode. Synchronized access guards against inconsistent updates by CHMOD(1) CHMOD(1) preventing concurrent opens for writing. Exclusive access guards against inconsistent views by preventing concurrent opens if one is for writing. EXAMPLES chmod o-w file Deny write permission to others. chmod +x file Make file executable. SEE ALSO ls(1), chmod(2), stat(2), chdate(1), chown(8)