chmod permission calculator
Tick permissions, or type 755 or rwxr-xr-x: each form follows the others, and you see who may do what.
Type the permissions
You can also paste a whole line of ls -l output into the box on the right.
- The owner can read it and change it
- The group can read it
- Everyone else can read it
Pick the permissions
| Read r see contents | Write w change contents | Execute x run as a program | Digit | |
|---|---|---|---|---|
| Owner u | 6 | |||
| Group g | 4 | |||
| Others o | 4 |
Commands
chmod 644 notes.txtchmod u=rw,go=r notes.txtBoth do the same: the number sets every permission at once; the letters are easier to read.
Try a symbolic mode
Type u+x, go-w, a=r, g=u or +x to see what it does, then apply it above.
chmodnotes.txt
-rw-r--r-- → -rwxr--r-- (744)
umask
New files start from 666 (files) or 777 (directories) minus the bits in the umask. Type one to see; umask in a terminal shows the current value.
- New files
- 644 -rw-r--r--
- New directories
- 755 drwxr-xr-x
Common modes
Good to know
- The three digits are owner, group and others; each is read 4 + write 2 + execute 1, so 7 = rwx, 5 = r-x, 6 = rw-.
- On a directory, x means you may enter it and reach what is inside; r without x only lists the names.
- Deleting a file needs w on the directory it is in, not on the file itself.
- A symbolic mode with no who (+x) works like a, but leaves the umask’s bits alone: with umask 022, chmod +w only gives the owner write permission.
- chmod -R gives directories and files the same mode; to add execute only to directories, use X: chmod -R u=rwX,go=rX dir.
- chmod 777 is almost never the right fix; find out which user needs which permission first.