Linux Permissions Reference
Cheat sheet for Unix file permissions: the rwx bits, octal digits, setuid/setgid/sticky, common modes, and umask.
This tool handles input and primary processing in your browser and is designed not to send the input to QuickKit’s server.
Permission bits
| Bit | Value | On a file | On a directory |
|---|---|---|---|
| r | 4 | Read the file's contents | List the names in the directory |
| w | 2 | Modify the file's contents | Create, delete, and rename entries (with x) |
| x | 1 | Execute the file as a program or script | Enter the directory and access entries by name |
Octal digit values
| Digit | Symbolic |
|---|---|
| 0 | --- |
| 1 | --x |
| 2 | -w- |
| 3 | -wx |
| 4 | r-- |
| 5 | r-x |
| 6 | rw- |
| 7 | rwx |
Special bits (leading digit)
| Bit | Value | ls character | Effect |
|---|---|---|---|
| setuid (u+s, 4) | 4 | s / S | Run an executable as its owning user; ignored on most shells' scripts |
| setgid (g+s, 2) | 2 | s / S | Run as owning group; on a directory, new entries inherit the group |
| sticky (+t, 1) | 1 | t / T | On a directory, only an entry's owner (or root) can delete or rename it |
umask defaults
| umask | New directory | New file | Typical use |
|---|---|---|---|
| 022 | 755 | 644 | Common default for a single-user or server system |
| 002 | 775 | 664 | Group-collaboration default (user private groups) |
| 027 | 750 | 640 | Others get no access — hardened default |
| 077 | 700 | 600 | Owner only — most restrictive common umask |
Behaviour of the execute bit on directories, setgid inheritance, and ACLs varies by filesystem and platform. Verify on the target system.
How it works
A static reference for POSIX file mode bits. The rwx bits mean different things for a regular file and for a directory: on a directory, r lists names, w creates and removes entries, and x allows traversing into it. Each octal digit 0–7 is the sum of r (4), w (2), and x (1). A leading fourth digit carries setuid (4), setgid (2), and the sticky bit (1); `ls` shows those in the execute column as s/t, or capital S/T when the matching execute bit is off. The common-modes table shows the symbolic form and typical use of familiar values like 644, 755, and 1777. The umask table shows the default file and directory modes each common umask produces. To compute a specific mode, use the Chmod Calculator.