find: Numeric Modes
1
1 5.3 Numeric Modes
1 =================
1
1 As an alternative to giving a symbolic mode, you can give an octal (base
1 8) number that represents the new mode. This number is always
1 interpreted in octal; you do not have to add a leading 0, as you do in
1 C. Mode 0055 is the same as mode 55.
1
1 A numeric mode is usually shorter than the corresponding symbolic
1 mode, but it is limited in that it cannot take into account a file's
1 previous permissions; it can only set them absolutely.
1
1 The permissions granted to the user, to other users in the file's
1 group, and to other users not in the file's group each require three
1 bits, which are represented as one octal digit. The three special
1 permissions also require one bit each, and they are as a group
1 represented as another octal digit. Here is how the bits are arranged,
1 starting with the lowest valued bit:
1
1 Value in Corresponding
1 Mode Permission
1
1 Other users not in the file's group:
1 1 Execute
1 2 Write
1 4 Read
1
1 Other users in the file's group:
1 10 Execute
1 20 Write
1 40 Read
1
1 The file's owner:
1 100 Execute
1 200 Write
1 400 Read
1
1 Special permissions:
1 1000 Restricted deletion flag or sticky bit
1 2000 Set group ID on execution
1 4000 Set user ID on execution
1
1 For example, numeric mode 4755 corresponds to symbolic mode
1 'u=rwxs,go=rx', and numeric mode 664 corresponds to symbolic mode
1 'ug=rw,o=r'. Numeric mode 0 corresponds to symbolic mode 'a='.
1