About the Chmod Calculator
Unix permissions are three groups of three bits — owner, group and others — each with read (4), write (2) and execute (1). Adding the values gives one octal digit per group: rwx = 7, r-x = 5, r-- = 4, so rwxr-xr-x is 755. A fourth leading digit holds the special bits: setuid 4, setgid 2 and sticky 1, as in 4755 or 1777.
On directories the bits mean something slightly different: read lists names, write creates and deletes entries, and execute allows entering the directory and accessing files by name. That is why directories are usually 755 while files are 644. The sticky bit on a shared directory like /tmp stops users from deleting each other's files, and setgid makes new files inherit the directory's group.
In ls -l output a lowercase s or t means the special bit and execute are both set; uppercase S or T means the special bit is set without execute, which is usually a mistake. The tool also writes the equivalent symbolic command, e.g. chmod u=rwx,g=rx,o=rx.
How to use it
- Tick read, write and execute for owner, group and others — or type an octal or symbolic value.
- Add setuid, setgid or sticky if needed.
- Enter the file name and choose recursive if it is a directory tree.
- Copy the chmod command and run it in your terminal.