Introduction
Sometimes you need to know which user you are logged in as or details about your user account. The whoami and id commands help you find out your current username and user identity information quickly.
When you want to confirm which user account you are currently using in a terminal session.
When you need to check your user ID (UID) and group ID (GID) for permissions troubleshooting.
When you want to see all groups your user belongs to for access control checks.
When running scripts that behave differently based on the current user identity.
When you want to verify if you have root or administrative privileges.