What command is used to display the active sessions on a Linux machine?

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

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The command that displays active sessions on a Linux machine is "who." This command shows the users currently logged into the system, along with information about their terminal sessions, such as login times and originating IP addresses or hostnames.

While the "w" command is also commonly used to display active sessions, it provides more detailed information about what the users are currently doing, showing their activity alongside other metrics such as the system uptime and how long each user has been idle. However, for purely listing logged-in users, "who" is the straightforward command intended for that purpose.

"ps" is used to display information about currently running processes, which does not specifically focus on user sessions. "top" provides a dynamic view of system processes and resource usage, focusing on performance metrics rather than user sessions. Thus, "who" is the best choice when the goal is to list currently active sessions.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy