octal mode

Writing a file mode as base-8 digits, one per class, where each digit is the sum of read 4, write 2 and execute 1.

In more detail

So 640 means owner read and write (6), group read (4), others nothing (0). A fourth leading digit holds the special bits: 4 setuid, 2 setgid and 1 sticky, so 1770 is a sticky shared directory. Octal replaces every bit at once, so use it when you know the complete target mode.

Example

mode=700 octal=700 u=rwx g=--- o=--- describes a private script only its owner can use.

Related terms

Taught in

References

Certification courses