In this article, you will learn about the whoami command.
whoami command is a command which you can use for getting the current user name. But It is the concatenation of the
Also, there is a similar command as the id command with the -un option.
How To Get The Help For The whoami Command
If you want to get help with the
whoami command then you can type the below command.
And you can see the below output.
Also, you can get the version of the
whoami command using the below option
Syntax Of The whoami Command
Also, you can see the syntax below.
How To Use The whoami Command
So if you want to get the current user then you can type in the below format
And you can see the below picture for the output
Other Command That Are Related To
There are few commands
What is the w command?
The w command shows who is logged on and what they are doing. So you only have to type the command.
The output of the above command, you can see in the below picture.
How To Use who Command
The who command will give you information about who is logged on the system. And you can type the command as in the below format.
How To Use who am i command
With who am i the who command will display only the line pointing to your current session. So you can type as below.
who am i
Also the output of who am i, you can see as the below
In this tutorial, you learned to use the w, who am i, and
whoami commands. If you have any questions then you can ask in the comment section. Also, if you find it useful then you can share it over Facebook, WhatsApp, or other media.
Also, you may use the below commands. So learn it.