LFCS w Practice Question
Which THREE commands can be used to list all users currently logged into the system?
⚠ Common exam trap
Candidates often confuse `last` (which shows historical logins) with `w`, `who`, or `users` (which show current logins). They may also overlook that `users` is a valid command, or mistakenly think `id` provides login status. While `w` and `who` are commonly taught, `users` is also correct and should not be dismissed.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
w
The `w` command displays detailed information about currently logged-in users, including login time, idle time, and current process. The `users` command lists the usernames of all users currently logged in. The `who` command shows a list of users currently logged in, typically with login time and session details. All three commands read from /var/run/utmp or similar system files to present active sessions, making them valid for listing current users.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
w
Why this is correct
Correct. The `w` command lists all currently logged-in users with detailed session information.
- ✗
last
Why it's wrong here
Incorrect. `last` displays historical login and logout records, not current users.
- ✓
users
Why this is correct
Correct. The `users` command outputs the usernames of all currently logged-in users.
- ✗
id
Why it's wrong here
Incorrect. `id` prints user identity and group memberships, not login status.
- ✓
who
Why this is correct
Correct. The `who` command lists all users currently logged in, showing login time and terminal.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LFCS question from scratch — 507 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.