Which command sets the sticky bit on a directory such as /shared?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command sets the sticky bit on a directory such as /shared?

Explanation:
The sticky bit is a special permission on directories that prevents users from deleting or renaming files owned by others inside that directory. To enable it, you add the sticky bit with chmod using add mode, which leaves existing permissions intact: chmod +t /shared. This is why that option is the best choice here—the command explicitly turns on the sticky bit without altering the other permissions. The other options don’t set the sticky bit. Removing it with -t would clear the sticky bit. Adding only +x changes execute permissions and does not touch the sticky bit. Using 0777 changes the standard read/write/execute bits for user, group, and others but does not enable the sticky bit, since the special-permission digit (the leading digit) remains 0; to include sticky with numeric mode you’d use something like 1777.

The sticky bit is a special permission on directories that prevents users from deleting or renaming files owned by others inside that directory. To enable it, you add the sticky bit with chmod using add mode, which leaves existing permissions intact: chmod +t /shared. This is why that option is the best choice here—the command explicitly turns on the sticky bit without altering the other permissions.

The other options don’t set the sticky bit. Removing it with -t would clear the sticky bit. Adding only +x changes execute permissions and does not touch the sticky bit. Using 0777 changes the standard read/write/execute bits for user, group, and others but does not enable the sticky bit, since the special-permission digit (the leading digit) remains 0; to include sticky with numeric mode you’d use something like 1777.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy