Question 540
A trainee already belongs to several groups and should additionally join editors without losing previous supplemental groups. One student proposes Run sudo usermod -aG editors trainee and another proposes Run sudo userdel -r oldtrainee. Which technical comparison is the soundest?
Explanation
Correct Answer
Correct distinction: Run sudo usermod -aG editors trainee targets append supplemental group; The -aG combination appends a supplemental group instead of replacing the existing list. The compared alternative instead serves remove account and home directory.
Incorrect Answers
Incorrect mapping: Run sudo userdel -r oldtrainee is used for remove account and home directory. It does not displace Run sudo usermod -aG editors trainee for the described requirement.
The mechanisms are different: The -aG combination appends a supplemental group instead of replacing the existing list. By contrast, userdel removes the account and -r requests removal of its home directory and mail spool. They are not universally interchangeable.
The third option addresses default home-directory templates: User-account creation tools commonly copy the skeleton directory into newly created home directories. The original action remains relevant because The -aG combination appends a supplemental group instead of replacing the existing list.