Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
File-system permissions
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Octal notation==== Permissions are often shown in [[octal]] notation; for example via the command <code>stat -c %a</code>. The notation consists of at least three digits. The last three digits represent the permission by class: user, group, and others. If a fourth digit is present, the leftmost represents the three special attributes: ''setuid'', ''setgid'' and ''sticky''. Each operation grant is assigned a bit position that for an octal digit is: * Read: left, binary 100, octal 4 * Write: middle, binary 010, octal 2 * Execute: right, binary 001, octal 1 A class permission value is the sum or alternatively the [[Logical disjunction|logic OR]] of the grants. Examples: {| class="wikitable" style="text-align: center;" |- ! Symbolic !! Octal !! Description |- | style="text-align: center;" | <code>----------</code> || 0000 || style="text-align: left" | no permissions |- | style="text-align: center;" | <code>-rwx------</code> ||0700|| style="text-align: left" | read, write, & execute only for owner |- | style="text-align: center;" | <code>-rwxrwx---</code> || 0770 || style="text-align: left" | read, write, & execute for owner and group |- | style="text-align: center;" | <code>-rwxrwxrwx</code> || 0777 || style="text-align: left" | read, write, & execute for owner, group and others |- | style="text-align: center;" | <code>-rwxr-----</code> || 0740 || style="text-align: left" | owner can read, write, & execute; group can only read; others have no permissions |- |} <!-- Here is a list of the meanings for individual octal digit values: 0 --- no permission 1 --x execute 2 -w- write 3 -wx write and execute 4 r-- read 5 r-x read and execute 6 rw- read and write 7 rwx read, write, and execute Here some example showing which digits affect permissions for user, group, and other: * 754 = <code>"-rwxr-xr--"</code> = rwx for owner, r-x for group, r-- for other * 124 = <code>"---x-w-r--"</code> = x for owner, w for group, r for other no permissions at all! ===Numeric notation and additional permissions=== There is also a ''four-digit'' form of numeric notation. In this scheme, the standard three digits described above become the last three digits. The first digit represents the additional permissions. On some systems, this first digit cannot be omitted; it is therefore common to use all four digits (where the first digit is zero). This first digit is also the sum of component bits: * The setuid bit adds 4 to the total, * The setgid bit adds 2 to the total, and * The sticky bit adds 1 to the total. The example from the ''Symbolic notation and additional permissions'' section, <code>"-rwsr-Sr-x"</code> would be represented as <code>6745</code> in four-digit octal. In addition, the examples in the previous section (<code>755</code>, <code>664</code>, and <code>500</code>) would be represented as <code>0755</code>, <code>0664</code>, and <code>0500</code> respectively in four-digit octal notation. -->
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)