$whoami
Print the effective username associated with the current shell session.
whoami [OPTIONS]Try `whoami` Live in Interactive Sandbox
Zero-install client simulation with real-time feedback.
Overview & How whoami Works
`whoami` outputs the username of the currently logged-in effective user. It is widely used in shell scripts to verify whether execution is running under root or an unprivileged service account.
Common Flags & Command Options
| Flag / Option | Description |
|---|---|
| --help | Display help summary and exit. |
| --version | Output version information and exit. |
Practical Real-World Examples
whoamiPrints current session username.
Frequently Asked Questions
How is whoami different from the id command?
`whoami` prints only the username string, whereas `id` prints the numeric UID, primary GID, and all secondary groups.
Related Linux Commands
Report a snapshot of currently running system processes.
Display real-time Linux processes and system resource utilization.
Interactive process viewer with colorful CPU meters and mouse support.
Send termination or control signals to processes by PID.
Execute a command with superuser (root) security privileges.
Display or set system date and time.