From LQWiki
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 $

This page is available under a