How Unix permissions work
Every file and directory has three sets of permissions: for its owner, its group, and others (everyone else).
Each set has three bits - read (4), write (2) and execute (1). Add them up per set to get one octal digit:
read + write + execute = 7, read + execute = 5, read + write = 6, read only = 4. So 755 means owner 7, group 5, others 5.
Files vs. directories
The same bits mean different things on a directory, which is why the explanation changes when you switch between File and Directory:
- Read on a directory lets you list the names inside.
- Write lets you create, delete and rename entries - but only together with execute.
- Execute lets you enter the directory and reach files inside by name. Without it, even readable files inside are off-limits.
Special bits
- setuid (4000) - an executable runs with the file owner's privileges (how
passwdcan update the password file). - setgid (2000) - on directories, new files inherit the directory's group: ideal for team folders.
- sticky (1000) - in a shared directory, only a file's owner can delete it (
/tmpis1777).
Use chmod -R with care: applying 755 recursively also makes every file executable. A safer pattern is
find dir -type d -exec chmod 755 {} + and find dir -type f -exec chmod 644 {} +.
Is my data uploaded?
No. Everything is calculated in your browser, so nothing you add is sent to gratistools.be. See the privacy page for details.
Common values
- 644 - Standard file
- 755 - Directories and programs
- 777 - Everyone can do everything
- 600 - Private file
- 700 - Private directory
- 400 - Read-only, owner only
- 775 - Shared team directory
- 664 - Group-editable file
- 2775 - Shared directory with setgid
- 1777 - Shared temp directory (sticky)
Frequently asked questions
Is this tool free?
Yes. The core tool is free to use in your browser.