Bird
0
0

What will be the output or effect of the command:

medium📝 Command Output Q13 of 15
Linux CLI - File Permissions and Ownership
What will be the output or effect of the command:
sudo chgrp -R developers /home/project?
AChange the group ownership of /home/project and all its contents to developers
BChange the user ownership of /home/project to developers
CChange the group ownership of /home/project only, not its contents
DShow an error because -R is invalid with chgrp
Step-by-Step Solution
Solution:
  1. Step 1: Understand the -R option

    The -R flag means recursive, so it applies the group change to the directory and all files and subdirectories inside it.
  2. Step 2: Understand the use of sudo

    sudo is used to run the command with root privileges, which is often needed to change group ownership on files you don't own.
  3. Final Answer:

    Change the group ownership of /home/project and all its contents to developers -> Option A
  4. Quick Check:

    chgrp -R changes group recursively [OK]
Quick Trick: Use -R to change group recursively on directories [OK]
Common Mistakes:
MISTAKES
  • Thinking -R only changes the directory itself
  • Confusing group change with user change
  • Assuming -R is invalid for chgrp

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes