Bird
0
0

You want to change the group of all files owned by user alice in /home/alice to staff. Which command correctly does this?

hard📝 Application Q9 of 15
Linux CLI - File Permissions and Ownership
You want to change the group of all files owned by user alice in /home/alice to staff. Which command correctly does this?
Achgrp -R staff /home/alice/alice
Bfind /home/alice -user alice -exec chgrp staff {} +
Cchgrp staff /home/alice/*
Dfind /home/alice -group alice -exec chgrp staff {} +
Step-by-Step Solution
Solution:
  1. Step 1: Select files owned by user alice

    The find command with -user alice filters files owned by alice.
  2. Step 2: Change group ownership on those files

    Using -exec chgrp staff {} + changes group to staff on all matched files.
  3. Final Answer:

    find /home/alice -user alice -exec chgrp staff {} + -> Option B
  4. Quick Check:

    Use find -user with exec chgrp for selective group change [OK]
Quick Trick: Use find -user to target files by owner before chgrp [OK]
Common Mistakes:
  • Using -group instead of -user
  • Assuming chgrp -R affects only alice's files
  • Not using find for selective ownership

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes