Bird
0
0

Which command correctly sets the setgid bit on a directory named shared?

easy📝 Syntax Q12 of 15
Linux CLI - File Permissions and Ownership
Which command correctly sets the setgid bit on a directory named shared?
Achmod g+s shared
Bchmod +s shared
Cchmod u+s shared
Dchmod o+s shared
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct chmod syntax for setgid

    The setgid bit is set using g+s with chmod on directories.
  2. Step 2: Verify options

    chmod g+s shared uses chmod g+s shared, which is correct. Other options use incorrect flags or users.
  3. Final Answer:

    chmod g+s shared -> Option A
  4. Quick Check:

    Setgid = chmod g+s [OK]
Quick Trick: Setgid uses 'g+s' with chmod on directories [OK]
Common Mistakes:
  • Using '+s' without user class
  • Confusing setuid (u+s) with setgid
  • Trying to set setgid on files with wrong syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes