Bird
0
0

What will be the output of the following commands?

medium📝 Command Output Q4 of 15
Linux CLI - Users and Groups
What will be the output of the following commands?
useradd -m charlie
id charlie
Auseradd: command not found
Buid=0(root) gid=0(root) groups=0(root)
Cid: charlie: no such user
Duid=1001(charlie) gid=1001(charlie) groups=1001(charlie)
Step-by-Step Solution
Solution:
  1. Step 1: Understand useradd -m charlie

    This command creates a new user named charlie with a home directory.
  2. Step 2: Understand id charlie output

    The id command shows user ID, group ID, and groups for charlie, which will be a new user with a unique uid and gid, typically starting at 1001.
  3. Final Answer:

    uid=1001(charlie) gid=1001(charlie) groups=1001(charlie) -> Option D
  4. Quick Check:

    New user id output = uid=1001(charlie) [OK]
Quick Trick: id shows user info after useradd [OK]
Common Mistakes:
MISTAKES
  • Expecting root user info
  • Assuming useradd fails without sudo
  • Thinking id shows no user

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes