CompTIA Linux+ (XK0-005) — Question 131
A Linux engineer is setting the sticky bit on a directory called devops with 755 file permission. Which of the following commands will accomplish this task?
Answer options
- A. chown -s 755 devops
- B. chown 1755 devops
- C. chmod -s 755 devops
- D. chmod 1755 devops
Correct answer: D
Explanation
The sticky bit is set using the chmod command, and the correct syntax for setting it along with the existing permissions is 'chmod 1755 devops'. The other options either use the wrong command (A and C with chown) or an incorrect syntax that does not apply the sticky bit properly (B).