cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Starfighter Starfighter
Starfighter
  • 69 Views

Current User Logged In

Which of the following commands displays the
username of the currently logged in user?

- who

- whoami

- id

- username

 

 

Trevor "Red Hat Evangelist" Chandler
Labels (3)
0 Kudos
2 Replies
Ad_astra
Flight Engineer Flight Engineer
Flight Engineer
  • 34 Views

Hi

The answer to this question is the 'whoami' command.

The 'who' command returns all the users currently logged in to the system.

The 'id' command returns the current user's id (uid), their group id (gid) and all groups they are members of.

I am not aware of the username command!

Regards

AA

0 Kudos
Trevor
Starfighter Starfighter
Starfighter
  • 14 Views

I'm liking the "id" command, as well as the "whoami" command.

Granted, the "id" command displays userid, groupid, etc. information.
Had the query been phrased as "...displays ONLY the username ...",
then the "whoami" command certainly would have the only acceptable
choice. However, I do understand your reasoning.

Thanks for responding!!!

Trevor "Red Hat Evangelist" Chandler
Join the discussion
You must log in to join this conversation.