Bird
0
0

What will be the output of the command id alice if user 'alice' exists with UID 1001 and belongs to groups 'users' and 'admin'?

medium📝 Command Output Q13 of 15
Linux CLI - Users and Groups
What will be the output of the command id alice if user 'alice' exists with UID 1001 and belongs to groups 'users' and 'admin'?
Auid=1001(alice) gid=1001(alice) groups=1001(alice),1002(admin)
Buid=1001(alice) gid=100(users) groups=100(users),101(admin)
Cuid=1001(alice) gid=1001(alice) groups=1001(alice),1002(users),1003(admin)
Duid=1001(alice) gid=1001(alice) groups=1001(alice),1002(admin),1003(users)
Step-by-Step Solution
Solution:
  1. Step 1: Understand id command output

    The id command shows user ID (uid), group ID (gid), and groups with their IDs.
  2. Step 2: Match given user and groups

    User 'alice' has UID 1001 and belongs to groups 'users' and 'admin'. The gid usually matches the user's primary group, here 1001(alice). Groups listed include primary and secondary groups with their IDs.
  3. Final Answer:

    uid=1001(alice) gid=1001(alice) groups=1001(alice),1002(users),1003(admin) -> Option C
  4. Quick Check:

    id shows uid, gid, groups = uid=1001(alice) gid=1001(alice) groups=1001(alice),1002(users),1003(admin) [OK]
Quick Trick: id command shows user and group IDs clearly [OK]
Common Mistakes:
  • Mixing group IDs and names incorrectly
  • Assuming gid is 'users' instead of user's primary group
  • Adding extra groups not specified

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes