chmod 664 Explained — Owner+Group Read-Write, Others Read-Only
Understand the 664 permission in Linux. Owner and group can read and write; others can only read. Used for shared project files with umask 002.
Detailed Explanation
What Does chmod 664 Mean?
Permission 664 allows collaborative editing within a group while keeping the file readable by others:
| Role | Octal | Symbolic | Permissions |
|---|---|---|---|
| Owner | 6 | rw- | Read + Write |
| Group | 6 | rw- | Read + Write |
| Others | 4 | r-- | Read only |
Where Is 664 Used?
# Shared source code files
chmod 664 /shared/project/main.py
# Collaborative documents
chmod 664 /shared/docs/readme.txt
# Shared configuration files
chmod 664 /etc/myapp/app.conf
664 and umask 002
Permission 664 is the default file permission when umask is set to 002:
666 & ~002 = 664
Many collaborative environments configure umask 002 to enable group writing by default.
Setting Up Group Collaboration
# 1. Create a shared group
sudo groupadd devteam
# 2. Add users to the group
sudo usermod -aG devteam alice
sudo usermod -aG devteam bob
# 3. Set group ownership
sudo chown -R :devteam /shared/project
# 4. Set SGID so new files inherit the group
chmod 2775 /shared/project
# 5. Set umask for group writing
umask 002
# Now new files are automatically 664
touch /shared/project/newfile.txt
ls -l /shared/project/newfile.txt
# -rw-rw-r-- 1 alice devteam ...
664 vs 644
| Permission | Group can write? | Default umask |
|---|---|---|
| 644 | No | 022 (standard) |
| 664 | Yes | 002 (collaborative) |
Use 664 when team members in the same group need to edit files. Use 644 on single-user systems or when group write access is not needed.
Use Case
Development teams working on shared codebases, documentation teams collaborating on files, and any environment where multiple users in the same group need write access to the same files. Often combined with SGID directories and umask 002.
Try It — Linux Permission Reference
Related Topics
chmod 644 Explained — Owner Read-Write, Others Read-Only
Common Permissions
Linux SGID (Set Group ID) Explained — Shared Directories with chmod 2775
Special Permissions
Understanding umask 022 — The Linux Default
Umask & Defaults
chmod 755 Explained — Owner Full, Others Read+Execute
Common Permissions
chmod 640 Explained — Owner Read-Write, Group Read-Only
Common Permissions