Permissions
Who is allowed to do what? One click sets or clears a permission.
| Readr · 4 | Writew · 2 | Executex · 1 | |
|---|---|---|---|
| Owneruser | |||
| Groupgroup | |||
| Othersothers |
Special bits (optional)
Common values
Result
Both fields are editable - input is applied instantly.
Command
Adjust the file name and copy.
chmod 644 file.txt
chmod u=rw,g=r,o=r file.txt
In short
The three permissions do not mean the same thing for files and directories - that is the most common pitfall.
| Permission | On a file |
|---|---|
| r (4) - read | Read the contents of the file |
| w (2) - write | Change or overwrite the contents |
| x (1) - execute | Run the file as a program or script |
| Permission | On a directory |
|---|---|
| r (4) - read | List the file names inside |
| w (2) - write | Create, rename and delete entries |
| x (1) - execute | Enter the directory and access its contents |
The octal value is simply the sum per digit: 4 + 2 + 1 = 7 (everything), 4 + 2 = 6 (read and write), 4 + 1 = 5 (read and execute). The three digits stand for owner, group and everyone else - so 644 means the owner may read and write, everyone else may only read. In symbolic notation a special bit shows up as s or t (uppercase when the matching execute bit is missing).