Linux Octal Permissions: Reading and Setting chmod Values
Linux expresses file permissions as three digits — 755, 644, 600. Each digit is a single octal number that encodes three yes-or-no answers at once. Once you see why octal was chosen, the notation stops being something to memorize and becomes something you can derive on the spot, which is exactly what the Linux+ exam wants. Why octal Every file has three permission bits for each of three identities. The bits are read, write, and execute; the identities are the owner (user), the group, and everyone else (other). Three bits per identity means eight possible combinations, and eight possible values is precisely one octal digit. Three identities, three digits. Inside a digit the bits carry fixed weights: read is 4, write is 2, execute is 1. Add the ones you want. Read plus write is 6. Read plus execute is 5. All three is 7. Read only is 4. Nothing is 0. Because 4, 2, and 1 are powers of two, every sum is unique — there is only one way to make each number from 0 through 7, so ...