How this calculator works
Each permission class has read, write and execute bits with weights 4, 2 and 1. Three octal digits describe owner, group and others. An optional leading digit controls setuid, setgid and sticky bits. Symbolic notation uses s or t when a special bit and execute bit are both set, and uppercase S or T when execute is absent. The generated command is text only.
Formula
octal digit = 4 x read + 2 x write + execute. Special digit = 4 x setuid + 2 x setgid + sticky.
Worked example
755 means rwxr-xr-x. Mode 4755 adds setuid and displays rwsr-xr-x. Mode 640 means rw-r-----.
Advertisement
Frequently asked questions
Does this change a file?
No. It only produces a command string. Replace path yourself if you choose to run it.
What is the sticky bit for?
On a directory it limits who may remove or rename entries, subject to operating system rules.
Are directory permissions the same as file permissions?
The bits are the same, but execute means directory traversal and write controls directory entries. ACLs and filesystem rules can add restrictions.