Permissions Calculator
Convert Unix permissions between octal, symbolic notation, and a chmod command.
Reading a permission line
A permission string is ten characters when you include the file type, or nine when you mean only the mode. The type is d for a directory, - for a regular file, and l for a symlink. Then three groups: owner, group, other. r, w, and x are read, write, and execute. On a directory, execute means you may traverse it, and write means you may create or remove names in it. Write on a directory without the sticky bit lets you delete other people's files.
This calculator turns a symbolic string into octal and back, so you can check a mode before you type chmod. rwxr-xr-x is 755. rw-r----- is 640. If you set the setuid bit, the owner execute position is s when execute is also set, or S when it is not. Setgid is the same letter in the group execute position. The sticky bit is t or T in the other execute position.
Work an example from ls. A directory that shows drwxrwsr-x is setgid and 2775: owner rwx, group rwx with setgid, other rx. New files in that directory inherit the group. A directory that shows drwxrwxrwt is 1777, the sticky bit, which is what /tmp looks like.
The tool does not walk a filesystem and it does not apply ACLs. getfacl is the command when the plus sign appears at the end of an ls mode. Symlinks are followed or not depending on the command you use later; the calculator only translates the bits you type.
