Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

chmod(1) [minix man page]

CHMOD(1)						      General Commands Manual							  CHMOD(1)

chmod - change access mode for files SYNOPSIS
chmod [-R] mode file ... OPTIONS
-R Change hierarchies recursively EXAMPLES
chmod 755 file # Owner: rwx Group: r-x Others: r-x chmod +x file1 file2 # Make file1 and file2 executable chmod a-w file # Make file read only chmod u+s file # Turn on SETUID for file chmod -R o+w dir # Allow writing for all files in dir DESCRIPTION
The given mode is applied to each file in the file list. If the -R flag is present, the files in a directory will be changed as well. The mode can be either absolute or symbolic. Absolute modes are given as an octal number that represents the new file mode. The mode bits are defined as follows: 4000 Set effective user id on execution to file's owner id 2000 Set effective group id on execution to file's group id 0400 file is readable by the owner of the file 0200 writeable by owner 0100 executable by owner 0070 same as above, for other users in the same group 0007 same as above, for all other users Symbolic modes modify the current file mode in a specified way. The form is: [who] op permissions { op permissions ...} {, [who] op ... } The possibilities for who are u, g, o, and a, standing for user, group, other and all, respectively. If who is omitted, a is assumed, but the current umask is used. The op can be +, -, or =; + turns on the given permissions, - turns them off; = sets the permissions exclu- sively for the given who. For example g=x sets the group permissions to --x. The possible permissions are r, w, x; which stand for read, write, and execute; s turns on the set effective user/group id bits. s only makes sense with u and g; o+s is harmless. SEE ALSO
ls(1), chmod(2). CHMOD(1)

Check Out this Related Man Page

CHMOD(1)						      General Commands Manual							  CHMOD(1)

chmod - change mode SYNOPSIS
chmod [ -Rf ] 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 con- structed 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, - 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. EXAMPLES
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. SEE ALSO
ls(1), chmod(2), stat(2), umask(2), chown(8) 7th Edition May 22, 1986 CHMOD(1)
Man Page