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
- file mode — The set of permission bits stored with each file that says what the owner, the group and everyone else may do with it.
- symbolic mode — A chmod permission change written as who, operator and rights, such as u+x or go-w.
- read, write and execute permissions — The three basic permissions in a file mode: read (r, 4) to view, write (w, 2) to change and execute (x, 1) to run.
- chmod — A command that changes a file's permission bits, using either octal digits or symbolic changes.
Taught in
- Reading And Setting A File Mode — Linux Fundamentals & Systems Administration
- Directories, Umask And The Sticky Bit — Linux Fundamentals & Systems Administration
- Anatomy Of A Playbook: Plays, Tasks And Modules — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: People, Passwords And sudo From The Vault — RHCE in Ansible (EX294): Automate Red Hat Systems