RHEL Linux - Red Hat System Administration Practice Exam

Disable ads (and more) with a membership for a one time $4.99 payment

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


To see a list of users that are currently logged in, you can use the command _______

  1. id

  2. su

  3. w

  4. whoami

The correct answer is: w

The command that allows you to view a list of users currently logged into the system is the "w" command. When executed, this command provides a snapshot of the current user activity on the machine, displaying not only the usernames of logged-in users but also additional details such as their login times, idle times, and what processes they are running. This information can be very useful for administrators looking to monitor user activity. The "id" command is designed to show user and group identity information for the current user, but it does not list other users currently logged in. The "su" command is used to switch to another user account, typically requiring the target user's password, and does not provide information about logged-in users. The "whoami" command simply displays the username of the current effective user, which means it also does not show other users present on the system. Using "w" is optimal for getting a comprehensive view of all active sessions and user activities on the server.