Which of the following commands set the sticky bit for the directory /tmp? (Choose TWO correct answers.)
Correct Answer: B,C
Explanation
The sticky bit is a special permission bit that can be set for directories. It prevents users from deleting or renaming files in the directory that they do not own, even if they have write permission on the directory. This is useful for shared directories like /tmp, where users can create temporary files but not interfere with other users' files12. The command chmod +t /tmp sets the sticky bit for the directory /tmp by adding the letter t to the end of the permission string. The command chmod 1775 /tmp also sets the sticky bit for the directory /tmp by adding the number 1 to the beginning of the octal mode. The number 1 represents the sticky bit in the octal notation34. The commands chmod +s /tmp, chmod 4775 /tmp, and chmod 2775 /tmp do not set the sticky bit, but rather the setuid or setgid bits, which are different special permission bits that affect how programs are executed5. References: 1: Sticky bit - Wikipedia 2: Linux Sticky Bit Concept Explained with Examples 3:
chmod(1) - Linux man page 4: Understanding Linux File Permissions 5: Setuid and Setgid on Linux - GeeksforGeeks