View the Most Wanted LQ Wiki articles.    
LinuxQuestions.org > Linux Wiki > Whoami

From LQWiki

Jump to: navigation, search

The command whoami simply outputs the username of the currently logged in user. If your username is "foo", then, for example:

$ whoami
foo
$

This command is useful to remind you of which user you are, say, if you are connecting to several machines, or you are using su to substitute a different user than your own, or in other circumstances. For this reason, most shell prompts have the capability of placing the username in the prompt (as well as the hostname), for example

foo@somehost $

Provided by

Most (all?) Linux distributions incorporate this from the GNU Coreutils: and use its man page

Related Commands

All of these relate to user information.

  • id - dump UID and GID information.
  • logname - show the login name.
  • groups - show groups of the current user.
  • users - show who is logged in.
  • who - show who is logged in from where.

This article is a stub and needs to be finished. Plunge forward and help it grow!



Personal tools
Sponsored Links