(coreutils.info.gz) Numeric Modes
Info Catalog
(coreutils.info.gz) Symbolic Modes
(coreutils.info.gz) File permissions
(coreutils.info.gz) Directory Setuid and Setgid
27.3 Numeric Modes
==================
As an alternative to giving a symbolic mode, you can give an octal
(base 8) number that represents the mode. This number is always
interpreted in octal; you do not have to add a leading `0', as you do
in C. Mode `0055' is the same as mode `55'. However, adding leading
zeros to create octal number with at least 5 digits means that this
mode is taken explicitly - so could clear even the set-user-ID and
set-group-ID bits of directories.
A numeric mode is usually shorter than the corresponding symbolic
mode, but it is limited in that normally it cannot take into account the
previous file mode bits; it can only set them absolutely. (As
discussed in the next section, the set-user-ID and set-group-ID bits of
directories are an exception to this general limitation.)
The permissions granted to the user, to other users in the file's
group, and to other users not in the file's group each require three
bits, which are represented as one octal digit. The three special mode
bits also require one bit each, and they are as a group represented as
another octal digit. Here is how the bits are arranged, starting with
the lowest valued bit:
Value in Corresponding
Mode Mode Bit
Other users not in the file's group:
1 Execute/search
2 Write
4 Read
Other users in the file's group:
10 Execute/search
20 Write
40 Read
The file's owner:
100 Execute/search
200 Write
400 Read
Special mode bits:
1000 Restricted deletion flag or sticky bit
2000 Set group ID on execution
4000 Set user ID on execution
For example, numeric mode `4755' corresponds to symbolic mode
`u=rwxs,go=rx', and numeric mode `664' corresponds to symbolic mode
`ug=rw,o=r'. Numeric mode `0' corresponds to symbolic mode `a='.
Info Catalog
(coreutils.info.gz) Symbolic Modes
(coreutils.info.gz) File permissions
(coreutils.info.gz) Directory Setuid and Setgid
automatically generated by
info2html