whoami command is used both in Unix Operating System and as well as in Windows Operating System.
- It is basically the concatenation of the strings “who”,”am”,”i” as whoami.
- It displays the username of the current user when this command is invoked.
- It is similar as running the id command with the options -un.
The earliest versions were created in 2.9 BSD as a convenience form for who am i, the Berkeley Unix who command’s way of printing just the logged in user’s identity. The GNU version was written by Richard Mlynarik and is part of the GNU Core Utilities (coreutils).
Options of Whoami
geekforgeeks@HP~: whoami [OPTION]
1. –help Option :
It gives the help message and exit.
geekforgeeks@HP~: whoami --help
2. –version Option :
It gives the version information and exit.
geekforgeeks@HP~: whoami --version
Commands related to whoami command are as follows :
1. w — Show who is logged on and what they are doing.
2. who — Report which users are logged in to the system.
- who command in Linux
- du Command in LINUX
- 'dd' command in Linux
- while command in Linux with example
- od command in Linux with example
- SED command in Linux | Set 2
- rcp Command in Linux with examples
- tty command in Linux with examples
- fc Command in Linux with Examples
- ssh command in Linux with Examples
- fmt command in Linux with examples
- less command in Linux with Examples
- id command in Linux with examples
- rm command in Linux with examples
- wc command in Linux with examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.