What is the whoami command in Linux?

The whoami command returns the username of the current user.

Syntax

whoami [OPTION]
OPTION Description
--version Displays the version information of the command
--help Displays the command description and options

Code

whoami
echo "-----"
whoami --version
echo "-----"
whoami --help
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources