chmod 664 Permission Explained: Group-Writable File
Octal
664
Symbolic
rw-rw-r--
Binary
110 110 100
Risk Level
Moderate
Summary: Owner and group can edit; others read.
| Class | Read (4) | Write (2) | Execute (1) | Octal |
|---|---|---|---|---|
| Owner (u) | 6 | |||
| Group (g) | 6 | |||
| Others (o) | 4 |
664
rw-rw-r--
Owner: read/write · Group: read/write · Others: read
chmod 664 filename
Moderate
Every member of the group can modify this file.
View the full chmod 664 guide →
Advertisement
chmod 664 Breakdown
| Class | Digit | Symbolic | On a file | On a directory |
|---|---|---|---|---|
| Owner (u) | 6 |
rw- |
Read and write | Can list names, cannot enter |
| Group (g) | 6 |
rw- |
Read and write | Can list names, cannot enter |
| Others (o) | 4 |
r-- |
Read only | Can list names, but not enter |
Is chmod 664 Safe?
Moderate
- Every member of the group can modify this file.
- Any user can read this file — never use it for secrets such as keys or .env files.
When not to use it
- Configuration files storing secrets, passwords, or single-user environments
Common Use Cases
- Collaborative source files and shared git checkouts in multi-user teams
- Shared data files edited by developers belonging to the same Unix group
chmod 664 Command Examples
# Apply using octal mode
chmod 664 filename
# Apply using equivalent symbolic mode
chmod u=rw,g=rw,o=r filename
# Recursive command warning:
chmod -R 664 /path/to/dir
# Note: -R applies the same mode to files and directories. Use find to treat them separately:
find /path/to/dir -type f -exec chmod 664 {} +
# Verify permissions
stat -c '%a %A %n' filename # Linux
stat -f '%Lp %Sp %N' filename # macOS
# Example ls -l output:
-rw-rw-r-- 1 alice staff 1024 Jan 15 10:00 example.txt
umask Relationship
A umask of 113 makes new directories 664 and new files 664. Test umask values with our interactive Umask Calculator.
Advertisement
Frequently Asked Questions
What does chmod 664 mean?
Owner and group can edit; others read. In octal notation, the owner receives 6 (read/write), the group receives 6 (read/write), and others receive 4 (read).
Is chmod 664 safe?
chmod 664 is classified as Moderate. Every member of the group can modify this file.
What is chmod 664 in symbolic notation?
In symbolic notation, chmod 664 is represented as rw-rw-r--. You can apply this permission using the equivalent symbolic command "chmod u=rw,g=rw,o=r filename".
Related Permissions
Change one bit:
chmod 264
remove owner read
chmod 464
remove owner write
chmod 764
add owner execute
chmod 624
remove group read
chmod 644
remove group write
chmod 674
add group execute
chmod 660
remove others read
chmod 666
add others write
chmod 665
add others execute
Often compared: chmod 644 vs 664
Related Guides
Advertisement