whoami

Print the username associated with the current effective user ID. More information: <https://www.gnu.org/software/coreutils/whoami>.

Install

All systems
curl cmd.cat/whoami.sh
Debian Debian
apt-get install coreutils
Ubuntu
apt-get install coreutils
Alpine
apk add coreutils
Arch Arch Linux
pacman -S coreutils
image/svg+xml Kali Linux
apt-get install coreutils
CentOS
yum install coreutils
Fedora
dnf install coreutils
Windows (WSL2)
sudo apt-get update sudo apt-get install coreutils
OS X
brew install coreutils
Raspbian
apt-get install coreutils
Docker
docker run cmd.cat/whoami whoami powered by Commando

Print the username associated with the current effective user ID. More information: <https://www.gnu.org/software/coreutils/whoami>.

  • Display currently logged username:
    whoami
  • Display the username after a change in the user ID:
    sudo whoami

© tl;dr; authors and contributors