chmod 2775 (rwxrwsr-x)
Like 775, with setgid. The usual mode for a shared project directory where every new file should belong to the team group.
rwxrwsr-xWho can do what
| Read | Write | Execute | |
|---|---|---|---|
| Owner | ✓ | ✓ | ✓ |
| Group | ✓ | ✓ | ✓ |
| Others | ✓ | – | ✓ |
- Owner can read, write and execute.
- Group can read, write and execute.
- Others can read and execute.
- setgid: the file runs with the group's privileges, and new files in a directory inherit its group.
Commands
Set the mode
chmod 2775 my-dir # same thing in symbolic form: chmod u=rwx,g=rwxs,o=rx my-dir
In ls -l output, a file with this mode shows as -rwxrwsr-x and a directory as drwxrwsr-x.
Try a different mode
| Read | Write | Execute | Special | |
|---|---|---|---|---|
| Owner | ||||
| Group | ||||
| Others |
Octal Symbolic
Command