0
0
Linux CLIscripting~5 mins

whoami and id commands in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the whoami command do in Linux?
The whoami command shows the username of the current user who is logged in and running the shell.
Click to reveal answer
beginner
What information does the id command provide?
The id command shows the user ID (UID), group ID (GID), and the groups the current user belongs to.
Click to reveal answer
intermediate
How can id help in understanding user permissions?
By showing the UID, GID, and groups, id helps you know what permissions the user has based on group memberships.
Click to reveal answer
intermediate
What is the difference between whoami and id -un?
whoami and id -un both show the current username, but id -un is part of the id command options.
Click to reveal answer
intermediate
Can id show information about other users?
Yes, by adding a username after id, like id username, it shows that user's UID, GID, and groups.
Click to reveal answer
What does the whoami command display?
AList of all users
BCurrent user's password
CCurrent user's username
DCurrent user's home directory
Which command shows the user ID (UID) and group ID (GID)?
Aid
Bwhoami
Cpwd
Dgroups
How do you use id to see information about another user named 'alice'?
Aid alice
Bid -u alice
Cwhoami alice
Dgroups alice
Which command would you use to find your current username quickly?
Aid -un
Bwhoami
Cid -g
DBoth A and B
What does the id command NOT show by default?
AGroup ID (GID)
BUser's home directory
CUser ID (UID)
DGroups the user belongs to
Explain what the whoami and id commands do and when you might use each.
Think about checking who you are vs. what groups you belong to.
You got /4 concepts.
    Describe how you would find out the groups a user belongs to using Linux commands.
    Focus on commands that reveal group info.
    You got /4 concepts.