![Forrest logo](/images/logo.png)
whoami
whoami
is a command line tool commonly found in Unix and Unix-like operating systems.
It allows you to quickly identify the username of the current user logged into the system.
When executed, it retrieves the current username from the system's user database and displays it on the terminal.
By default, it returns the login name of the user executing the command.
The whoami
command is often used in shell scripts and system administration tasks where knowing the current user is important.
It is primarily used for scripting purposes, such as differentiating between users and executing specific commands based on the user's identity.
In multi-user systems, whoami
helps to determine the effective rights and permissions for the current user.
In addition to providing the username, whoami
can also be combined with other commands to gather supplementary user information.
This command is simple, fast, and essential for user identification and script automation in a command line environment.
List of commands for whoami:
-
whoami:tldr:15182 whoami: Display the privileges of the current user.$ whoami /privtry on your machineexplain this command
-
whoami:tldr:1b067 whoami: Display currently logged username.$ whoamitry on your machineexplain this command
-
whoami:tldr:2ebf5 whoami: Display the user principal name (UPN) of the current user.$ whoami /upntry on your machineexplain this command
-
whoami:tldr:9ed0c whoami: Display the logon ID of the current user.$ whoami /logonidtry on your machineexplain this command
-
whoami:tldr:a58db whoami: Display the groups that the current user is a member of.$ whoami /groupstry on your machineexplain this command
-
whoami:tldr:e821c whoami: Display all information for the current user.$ whoami /alltry on your machineexplain this command