chmod 664
chmod 664 is rw-rw-r--.
What 664 grants
| Who | Digit | Permissions | Adds up as |
|---|---|---|---|
| Owner | 6 | read, write | 4 + 2 = 6 |
| Group | 6 | read, write | 4 + 2 = 6 |
| Others | 4 | read | 4 = 4 |
When 664 is the right answer
Owner and group write, everyone reads. The default on systems that use per-user groups, where a file being group-writable is harmless because the group has only one member.
The command
chmod 664 filename
chmod -R 664 directory/
Note that nobody has the execute bit here, so this value cannot be used on a directory that anyone needs to enter. On a directory, execute grants traversal rather than the right to run something.
How it is written elsewhere
| Octal | 664 |
| Symbolic | rw-rw-r-- |
As a file in ls -l | -rw-rw-r-- |
As a directory in ls -l | drw-rw-r-- |
| Binary | 110 110 100 |
| World-writable | No |
Frequently asked questions
What does chmod 664 mean?
It sets owner to read, write, group to read, write, others to read. In symbolic notation that is rw-rw-r--.
How do I apply 664?
Run chmod 664 filename. Add -R to apply it to a directory and everything inside, though be careful: a recursive numeric chmod marks every file the same way, which is rarely correct for a mixed tree of files and directories.
Is 664 safe?
It grants no write access outside the owner and the group, so it is a reasonable setting as long as the owner is the account you intend.
What is 664 in symbolic notation?
rw-rw-r--. Written as ls -l shows it, with a leading file-type character, an ordinary file would appear as -rw-rw-r-- and a directory as drw-rw-r--.