What command would you use to find out which user is currently logged in?

Explore the Linux Fundamentals Test. Revise with flashcards and multiple choice questions, each with hints and explanations. Prepare thoroughly for your Linux exam!

The command that reveals the user currently logged into the system is "whoami." When executed, this command returns the username associated with the current effective user ID, providing clear and direct feedback about who is logged in. This is particularly useful for confirmation of the active user when working on multi-user systems or in scenarios where user context might change.

The other commands serve different purposes: "ls" is used for listing directory contents, "cd" is a command to change directories, and "pwd" prints the current working directory. These commands do not provide information about the logged-in user, making them unsuitable for this particular inquiry.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy