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:
The system displays information similar to the following:whoami
In this example, the login name being used isdenise
denise
. - 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:
The system displays information similar to the following:who am i
In this example, the login name isdenise pts/0 Jun 21 07:53
denise
, the name of the terminal ispts/0
, and this user logged in at 7:53 a.m. on June 21. - 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:
The system displays information similar to the following:logname
In this example, the login name isdenise
denise
.