The whoami command displays the username of the current effective user. In other words it just prints the username of the currently logged in user when executed.
To display your effective user id just type whoami
in your terminal:
manish@godsmack:~$ whoami
# Output:
manish
Syntax:
whoami [-OPTION]
There are only two options which can be passed to it :
--help
: Used to display the help and exit
Example:
whoami --help
Output:
Usage: whoami [OPTION]...
Print the user name associated with the current effective user ID.
Same as id -un.
--help display this help and exit
--version output version information and exit
--version
: Output version information and exit
Example:
whoami --version
Output:
whoami (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard Mlynarik.