3 chmod \- change access mode for files
5 \fBchmod [\fB\-R\fR] \fImode \fIfile\fR ...\fR
18 .FL "\-R" "Change hierarchies recursively"
20 .EX "chmod 755 file" "Owner: rwx Group: r\-x Others: r\-x"
21 .EX "chmod +x file1 file2" "Make \fIfile1\fR and \fIfile2\fR executable"
22 .EX "chmod a\-w file" "Make \fIfile\fR read only"
23 .EX "chmod u+s file" "Turn on SETUID for \fIfile\fR"
24 .EX "chmod \-R o+w dir" "Allow writing for all files in dir"
27 The given mode is applied to each file in the file list. If the \fB\-R\fR
28 flag is present, the files in a directory will be changed as well.
29 The mode can be either absolute or symbolic. Absolute modes are given as an
30 octal number that represents the new file mode. The mode bits are defined as
35 4000 Set effective user id on execution to file's owner id
36 2000 Set effective group id on execution to file's group id
37 0400 file is readable by the owner of the file
38 0200 writeable by owner
39 0100 executable by owner
40 0070 same as above, for other users in the same group
41 0007 same as above, for all other users
44 Symbolic modes modify the current file mode in a specified way. The form is:
46 [who] op permissions { op permissions ...} {, [who] op ... }
48 The possibilities for \fIwho\fR are \fIu\fR, \fIg\fR, \fIo\fR, and \fIa\fR,
49 standing for user, group, other and all, respectively.
50 If \fIwho\fR is omitted, \fIa\fR is assumed, but the current umask is used.
51 The op can be \fI+\fR, \fI-\fR, or \fI=\fR; \fI+\fR turns on the
52 given permissions, \fI\- \fRturns them off; \fI=\fR sets the permissions
53 exclusively for the given \fIwho\fR.
54 For example \fIg=x\fR sets the group permissions to \fI--x\fR.
56 The possible permissions are \fIr\fR, \fIw\fR, \fIx\fR; which stand for read,
57 write, and execute; \fIs\fR turns on the set effective user/group id bits.
58 \fIs\fR only makes sense with \fIu\fR and \fIg\fR;\fR o+s\fR is