chmod(1) chmod(1)NAME chmod - changes the permissions of a file SYNOPSIS chmod mode file... ARGUMENTS file Specifies the files that will have its permissions changed. mode Specifies the mode to which the file will be changed. The modes are: 4000 Sets user ID on execution. 2000 Sets group ID on execution. 1000 Sets the sticky bit, see chmod(2). 0400 Allows read access by owner. 0200 Allows write access by owner. 0100 Allows execution (search in directory) by owner. 0070 Allows read, write, and execution by group. 0007 Allows read, write, and execution by others. DESCRIPTION The permissions of the named files are changed according to mode, which may be absolute or symbolic. An absolute mode is an octal number constructed from the R of the modes shown above. 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, the default if who is omitted. The op option can be + to add permission to the file's mode, - to take away permission, or = to assign permission absolutely (all other bits will be reset). The permission option is any combination of the letters r (read), w (write), x (execute), s (set owner or group ID) and t (save text, or sticky); 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 January 1992 1
chmod(1) chmod(1)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 and t only works with u. Only the owner of a file (or the superuser) may change its mode. Only the superuser may set the sticky bit. In order to set the group ID, the group of the file must correspond to your current group ID. EXAMPLES The command: chmod 755 filename changes the mode of filename to: read, write, execute (400+200+100) by owner; read, execute (40+10) for group; read, execute (4+1) for others. An ls -l of filename shows [-rwxr-xr-x filename] that the requested mode is in effect. The command: chmod = filename will take away all permissions from filename, including yours. The command: chmod o-w file denies write permission to others. The command: chmod +x file makes a file executable. FILES /bin/chmod Executable file SEE ALSO ls(1), chown(1), csh(1), ksh(1), sh(1) chmod(2) in A/UX Programmer's Reference A/UX Essentials A/UX Local System Administration 2 January 1992