Displaying your login name (whoami and logname commands)

When you have more than one concurrent login, it is easy to lose track of the login names or, in particular, the login name that you are currently using. You can use the whoami and logname commands to display this information.

Using the whoami command
To determine which login name is being used, at the prompt, type the following:
whoami
The system displays information similar to the following:
denise
In this example, the login name being used is denise.

See the whoami command in the Commands Reference, Volume 6 for the complete syntax.

Using the who am i command
A variation of the who command, the who am i command, allows you to display the login name, terminal name, and time of the login. At the prompt, type the following:
who am i
The system displays information similar to the following:
denise   pts/0   Jun 21 07:53
In this example, the login name is denise, the name of the terminal is pts/0, and this user logged in at 7:53 a.m. on June 21.

See the who command in the Commands Reference, Volume 6 for the complete syntax.

Using the logname command

Another variation of the who command, the logname command displays the same information as the who command.

At the prompt, type the following:
logname
The system displays information similar to the following:
denise
In this example, the login name is denise.