File mode syntax
File modes are described by a nine characters string that follows the same scheme as the
ls
shell command:
Position
|
Character
|
Meaning
|
1
|
-
|
The file owner cannot read it.
|
|
r
|
The file owner can read it.
|
2
|
-
|
The file owner cannot write it.
|
|
w
|
The file owner can write it.
|
3
|
-
|
The file owner cannot execute it.
|
|
x
|
The file owner can execute it.
|
|
S
|
The file owner cannot execute it and the 'setuid' bit is set.
|
|
s
|
The file owner can execute it and the 'setuid' bit is set.
|
4
|
-
|
The file group cannot read it.
|
|
r
|
The file group can read it.
|
5
|
-
|
The file group cannot write it.
|
|
w
|
The file group can write it.
|
6
|
-
|
The file group cannot execute it.
|
|
x
|
The file group can execute it.
|
|
S
|
The file group cannot execute it and the 'setgid' bit is set.
|
|
s
|
The file group can execute it and the 'setgid' bit is set.
|
7
|
-
|
Other users cannot read the file.
|
|
r
|
Other users can read the file.
|
8
|
-
|
Other users cannot write the file.
|
|
w
|
Other users can write the file.
|
9
|
-
|
Other users cannot execute the file.
|
|
x
|
Other users can execute the file.
|
|
T
|
Other users cannot execute the file and the 'sticky' bit is set.
|
|
t
|
Other users can execute the file and the 'sticky' bit is set.
|
See also