Can 'whoami' display the user's full name instead of just the username?

QuestionsQuestions8 SkillsProYour First Linux LabAug, 03 2025
0320

No, the whoami command only displays the username of the currently logged-in user. It does not provide the full name or any other user details. If you want to see the full name associated with a user, you can use the getent command like this:

getent passwd $(whoami)

This will return a line with user information, where the full name is typically the fifth field.

0 Comments

no data
Be the first to share your comment!