|
|
1.1 root 1: .\" @(#)chmod.1 6.3 (Berkeley) 5/22/86
2: .\"
3: .TH CHMOD 1 "May 22, 1986"
4: .AT 3
5: .SH NAME
6: chmod \- change mode
7: .SH SYNOPSIS
8: \fBchmod\fP [
9: .B \-Rf
10: ] mode file ...
11: .SH DESCRIPTION
12: The mode of each named file is changed according to \fImode\fP,
13: which may be absolute or symbolic. An absolute \fImode\fP
14: is an octal number constructed from the OR of the following modes:
15: .TP 10
16: 4000
17: set user ID on execution
18: .br
19: .ns
20: .TP 10
21: 2000
22: set group ID on execution
23: .br
24: .ns
25: .TP 10
26: 1000
27: sticky bit, see
28: .IR chmod (2)
29: .br
30: .ns
31: .TP 10
32: 0400
33: read by owner
34: .br
35: .ns
36: .TP 10
37: 0200
38: write by owner
39: .br
40: .ns
41: .TP 10
42: 0100
43: execute (search in directory) by owner
44: .br
45: .ns
46: .TP 10
47: 0070
48: read, write, execute (search) by group
49: .br
50: .ns
51: .TP 10
52: 0007
53: read, write, execute (search) by others
54: .LP
55: A symbolic \fImode\fP has the form:
56: .IP
57: .RI [ who ]
58: \fIop permission\fP
59: .RI [ "op permission" "] ..."
60: .LP
61: The \fIwho\fP part is a combination of the letters \fBu\fP
62: (for user's permissions), \fBg\fP (group) and \fBo\fP (other).
63: The letter \fBa\fP stands for all, or \fBugo.\fP
64: If \fIwho\fP is omitted, the default is \fIa\fP
65: but the setting of the file creation mask (see umask(2)) is taken into account.
66: .LP
67: \fIOp\fP can be \fB+\fP to add \fIpermission\fP to the file's mode,
68: \fB\-\fP to take away \fIpermission\fP and \fB=\fP to assign
69: \fIpermission\fP absolutely (all other bits will be reset).
70: .LP
71: \fIPermission\fP is any combination of the letters \fBr\fP (read),
72: \fBw\fP (write), \fBx\fP (execute),
73: \fBX\fP (set execute only if file is a directory
74: or some other execute bit is set),
75: \fBs\fP (set owner or group id)
76: and \fBt\fP (save text \- sticky).
77: Letters \fBu\fP, \fBg\fP, or \fBo\fP indicate that \fIpermission\fP
78: is to be taken from the current mode.
79: Omitting \fIpermission\fP
80: is only useful with \fB=\fP to take away all permissions.
81: .PP
82: When the
83: .B \-R
84: option is given,
85: .I chmod
86: recursively descends its directory arguments
87: setting the mode for each file as described above.
88: When symbolic links are encountered, their mode is not changed
89: and they are not traversed.
90: .PP
91: If the
92: .B \-f
93: option is given,
94: .I chmod
95: will not complain if it fails to change the mode
96: on a file.
97: .SH EXAMPLES
98: .LP
99: The first example denies write permission to others,
100: the second makes a file executable by all if it is executable by anyone:
101: .IP
102: chmod o\-w file
103: .br
104: chmod +X file
105: .LP
106: Multiple symbolic modes separated by commas may be given.
107: Operations are performed in the order specified. The letter
108: \fBs\fP is only useful with \fBu\fP or \fBg.\fP
109: .LP
110: Only the owner of a file (or the super-user) may change its mode.
111: .SH "SEE ALSO"
112: ls(1), chmod(2), stat(2), umask(2), chown(8)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.