All users can create files in a shared directory.
Prevent ordinary users from deleting or renaming files owned by others.
Which special mode should be added?
The sticky bit on a writable directory restricts deletion and renaming to the file owner, directory owner, or a privileged process.
Detailed explanation
Correct. The sticky bit enforces restricted deletion in a shared writable directory.
Correct. The sticky bit enforces restricted deletion in a shared writable directory.
Incorrect. setuid affects effective user identity.
Incorrect. setuid affects effective user identity.
Incorrect. setgid controls group inheritance.
Incorrect. setgid controls group inheritance.
Incorrect. A read-only bit is not the standard special mode for this rule.
Incorrect. A read-only bit is not the standard special mode for this rule.
Try it yourself
An example you can run in a temporary verification environment.
tmp=$(mktemp -d); chmod 1777 "$tmp"; stat -c '%A %a' "$tmp"; chmod 700 "$tmp"; rmdir "$tmp"Expected result
drwxrwxrwt 1777Key points
- Sticky bit
- The t position
- Common example is /tmp
Notes
- Environment: GNU coreutils 9.x / 一時ディレクトリ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.