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 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 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 does the sticky bit do in Linux permissions?
Open an interactive chat with Bash
Can you explain the difference between the setuid, setgid, and sticky bit?
Open an interactive chat with Bash
How does numeric mode work in Linux file permissions?