Chmod 222 Explained
Chmod 222: write-only for everyone. Nobody can read or execute. An extremely rare permission for specialized write-only logging.
Permission
222
-w--w--w-
chmod 222 filename
Permission Breakdown
| Role | Read (4) | Write (2) | Execute (1) | Octal | Meaning |
|---|---|---|---|---|---|
| Owner | - | w | - | 2 | write |
| Group | - | w | - | 2 | write |
| Others | - | w | - | 2 | write |
Visual Permission Grid
Detailed Explanation
The permission 222 grants only write access to everyone while denying read and execute permissions.
Octal breakdown:
- 2 (Owner): write (2) only
- 2 (Group): write (2) only
- 2 (Others): write (2) only
In symbolic notation this is -w--w--w-. Everyone can write to the file, but nobody can read or execute it. For directories, this permission is effectively useless since the execute bit is needed to access directory contents.
This is one of the rarest permissions in practice. For regular files, it creates a write-only file: processes can append data but cannot read what was written. This could be used for specialized logging or audit trails where writers should not be able to read previous entries. However, most real-world scenarios use more practical combinations like 620 or 660 instead.
Use Case
Theoretically used for write-only audit logs or anonymous feedback files, though in practice more practical permission sets like 620 or 660 are preferred.