Bird
0
0

If you run chgrp users file.txt but the group users does not exist, what will happen?

medium📝 Command Output Q5 of 15
Linux CLI - File Permissions and Ownership
If you run chgrp users file.txt but the group users does not exist, what will happen?
AThe file will be deleted
BThe command will fail with an error about the group not existing
CThe file's group will remain unchanged silently
DThe group will be created automatically and assigned
Step-by-Step Solution
Solution:
  1. Step 1: Understand group existence requirement

    The group specified must exist in the system; otherwise, the command fails.
  2. Step 2: Identify command behavior on invalid group

    If the group does not exist, chgrp returns an error and does not change the file.
  3. Final Answer:

    The command will fail with an error about the group not existing -> Option B
  4. Quick Check:

    Nonexistent group causes error [OK]
Quick Trick: Group must exist before using chgrp [OK]
Common Mistakes:
  • Assuming group auto-creation
  • Expecting silent failure
  • Thinking file gets deleted

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes