Bird
0
0

You try to run chgrp admins confidential.txt but receive the error: Operation not permitted. What is the most probable reason?

medium📝 Debug Q6 of 15
Linux CLI - File Permissions and Ownership
You try to run chgrp admins confidential.txt but receive the error: Operation not permitted. What is the most probable reason?
AYou do not own the file and lack sufficient privileges to change its group.
BThe group 'admins' does not exist on the system.
CThe file 'confidential.txt' is currently open by another user.
DThe file is located on a read-only filesystem.
Step-by-Step Solution
Solution:
  1. Step 1: Understand permission requirements

    Only the file owner or root can change the group ownership.
  2. Step 2: Analyze error cause

    If you are not the owner and lack sudo/root privileges, you get 'Operation not permitted'.
  3. Step 3: Other options

    Group non-existence causes a different error; open files or read-only filesystems cause other errors.
  4. Final Answer:

    You do not own the file and lack sufficient privileges to change its group. -> Option A
  5. Quick Check:

    Must own file or be root to chgrp [OK]
Quick Trick: Must own file or be root to chgrp [OK]
Common Mistakes:
  • Assuming group must exist causes this error
  • Thinking open files block chgrp
  • Ignoring ownership and privilege requirements

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes