Which command shows the users currently logged in?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

Which command shows the users currently logged in?

Explanation:
The key idea is identifying a command that queries the system’s user accounting data and prints who is actively logged in. That command reads the utmp records and shows one line per active session, typically including the username, the terminal (TTY), and the login time (and sometimes the remote host). This directly answers who is currently signed into the system. The other commands serve different purposes: date shows the current date and time; passwd is used to change a user’s password; uptime reports how long the system has been running and, in some outputs, how many users are logged in but not who they are. So they don’t provide a direct list of the users currently logged in, whereas this command does.

The key idea is identifying a command that queries the system’s user accounting data and prints who is actively logged in. That command reads the utmp records and shows one line per active session, typically including the username, the terminal (TTY), and the login time (and sometimes the remote host). This directly answers who is currently signed into the system.

The other commands serve different purposes: date shows the current date and time; passwd is used to change a user’s password; uptime reports how long the system has been running and, in some outputs, how many users are logged in but not who they are. So they don’t provide a direct list of the users currently logged in, whereas this command does.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy