Calculate chmod permissions
Tick read, write and execute boxes to get the chmod value in octal (755) and symbolic notation (rwxr-xr-x), or decode an existing mode.
Tick read, write and execute boxes to get the chmod value in octal (755) and symbolic notation (rwxr-xr-x), or decode an existing mode.
| Read (4) | Write (2) | Execute (1) | Digit | |
|---|---|---|---|---|
| Owner | 6 | |||
| Group | 4 | |||
| Others | 4 |
Octal and ls -l modes replace the ticked boxes; symbolic modes such as a+x or go-w change them.
644rw-r--r--chmod 644 filechmod u=rw,g=r,o=r fileRuns entirely in your browser: nothing you type is sent or stored.
| Permission | On a file | On a directory |
|---|---|---|
r read | ls) | |
w write | ||
x execute | cd) and reach the files inside |
r but no x shows the names of its files but none can be opened.
755 is 4 + 2 + 1 = 7 for the owner (rwx), 4 + 1 = 5 for the group (r-x) and 5 for the others, written rwxr-xr-x by ls -l.
755 as the bits 111 101 101. A fourth digit in front holds the special bits.
666 for files and 777 for directories, minus the bits of the umask. With the usual umask 022, which removes write for the group and the others, new files get 644 and new directories 755. A umask of 077 gives 600 and 700, nothing for anyone but you.
umask in a terminal to see yours, and umask 027 to change it for the session. Symbolic modes without a class, such as chmod +x, also follow the umask, whereas this calculator applies them to all classes.
passwd is -rwsr-xr-x and owned by root so that it can write the password file. Setgid (2000) does the same with the group, and on a directory makes new files inherit its group, handy for a shared project folder. The sticky bit (1000) on a directory lets users delete only their own files, as in /tmp (drwxrwxrwt).
s or t when x is also granted, S or T in capitals when it is not, which is usually a mistake.
| Mode | Symbolic | Typical use |
|---|---|---|
644 | rw-r--r-- | |
600 | rw------- | |
755 | rwxr-xr-x | |
700 | rwx------ | |
664 | rw-rw-r-- | |
775 | rwxrwxr-x | |
777 | rwxrwxrwx | |
1777 | rwxrwxrwt |