Linux whoami command
The Linux whoami command is used to display the current user's name.
Displays the current user's name; this command is equivalent to running "id -un".
Syntax
whoami [--help][--version]
Parameter Description:
- --help Online help.
- --version Display version information.
Example
Display the username
# whoami
root
Linux Command Reference