A Linux administrator needs to generate a quick report of all users currently logged into a multi-user server. The report should, at a minimum, show each user's login name, their terminal line, and the time they logged in. Which of the following commands will produce the required report?
The correct command is who. This command displays a list of all users who are currently logged into the system, including their username, terminal line, login time, and the remote host from which they are connected.
whoami is incorrect because it only prints the effective username of the current user.
last is incorrect as it displays a history of past user logins and logouts, rather than only showing who is currently logged in.
getent passwd is incorrect because it retrieves and lists all user accounts from the system's user database (like /etc/passwd), regardless of whether they are currently logged in.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
How does the `who` command work?
Open an interactive chat with Bash
What is the difference between `who` and `whoami`?
Open an interactive chat with Bash
When should I use `who` versus `last`?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access