Online Linux Terminal Logo
OnlineLinuxTerminal
Système et processusCLI Manual

$whoami

Print the effective username associated with the current shell session.

Syntaxe de la commandePOSIX Standard
whoami [OPTIONS]
Communauté Linux2.4k En ligne

Échangez avec des utilisateurs Linux, apprenez des commandes et téléchargez des PDF.

Essayer en direct dans le bac à sable interactif

Simulation côté client sans installation avec retour instantané.

Ouvrir dans le terminal plein écran ↗
bash — terminal

Aperçu et fonctionnement

`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.

Options et drapeaux courants

Flag / OptionDescription
--helpDisplay help summary and exit.
--versionOutput version information and exit.

Exemples pratiques du monde réel

#1Check active user identity

Prints current session username.