The command whoami simply outputs the username of the currently logged in user. If your username is "foo", then, for example:
$ whoami foo $
The command is useful to remind you which user login you are currently using, say, if you are connecting to several machines or you are using su in order to use a different user's permissions (e.g. root). For this reason, most shell prompts have the capability of placing the username in the prompt (as well as the hostname), for example
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.