Linux Commands: whoami

In this guide, we will explore the whoami command, which is used to print the current user name. This command works on Linux, macOS, WSL, and any UNIX environment. How to Use the whoami Command To print the user name currently logged in to the terminal session, simply type whoami and press Enter. Here’s an example: $ whoami john_doe Note: The whoami command should not be confused with the who am i command, which provides more detailed information....