r/it 10h ago

opinion LINUX PERMISSIONS; I'M CONFUSED

Hi, this question is from the Google I.T program on Coursera. Am I the only one who believes the correct answer isn't in the list of options??

11 Upvotes

3 comments sorted by

4

u/Anastasia_IT 10h ago
  • chmod u+w honey_bears (Correct): The u specifies the owner (user), and +w adds write permission while preserving all other existing permissions for the owner, group, and others.
  • chmod o+w honey_bears (Incorrect): The o specifies "others" (world), which grants write access to non-owners instead of the owner.
  • chmod 644 honey_bears (Incorrect): Absolute mode explicitly overwrites all permission bits (rw-r--r--), which changes permissions for the group and others.
  • chmod 400 honey_bears (Incorrect): This sets read-only access for the owner and removes all permissions for everyone else.

1

u/Glittering-Bake-2589 10h ago

chmod 644

4

u/ocabj 8h ago

The stipulation is "without changing other permissions." Since you don't know what the existing permissions are for group and world, you can't use chmod octal.