Difficulty: Easy
Correct Answer: who am i
Explanation:
Introduction / Context:
Unix provides several commands to reveal identity or session information. Distinguishing among them helps when auditing sessions, writing scripts, or troubleshooting access problems.
Given Data / Assumptions:
who
functionality.
Concept / Approach:
who am i
(equivalently who -m
on many systems) displays the entry for the current terminal, effectively showing who you are logged in as and on which TTY. Related commands include whoami
(prints just the username) and id
(UID/GID and groups). The options listed do not include whoami
, so the best match is who am i
.
Step-by-Step Solution:
who
restricted to current terminal.Use form who am i
to output the entry for the current TTY.Confirm output includes username and terminal.
Verification / Alternative check:
Run who am i
and compare with who
(shows all logins), whoami
(just the username), and id
(numeric IDs). You will see the difference clearly.
Why Other Options Are Wrong:
who am i
fits the requirement.
Common Pitfalls:
Confusing who am i
with whoami
; both are useful but return different information. Also, on some minimal systems, who
may behave slightly differently; who -m
is a common equivalent.
Final Answer:
who am i
Discussion & Comments