A directory at /data/shared currently has permissions set to 0777, allowing all users full access. You need to keep read, write, and execute rights for everyone but ensure that only file owners can remove or rename their own files. Which command achieves this goal?
The numeric mode prefix 1 applies the sticky bit. Mode 1777 grants read, write, and execute access to the owner, group, and others while restricting file deletion and renaming within the directory to the file's owner. Prefix 2 sets the setgid bit (group ID), prefix 6 sets both the setuid and setgid bits, and prefix 0 leaves no special bits, so other users could remove files they don't own.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the sticky bit in Linux?
Open an interactive chat with Bash
What is the difference between setuid, setgid, and the sticky bit?
Open an interactive chat with Bash
Why is `chmod 1777` preferred for shared directories like /data/shared?