Ad space (banner)
🖥️Linux Lessons
Lesson 14 / 61

Checking Who You Are with whoami

whoami is for when "I want to confirm which user I'm currently logged in as." whoami displays the username of whoever is currently operating the terminal.

It's a simple command that needs no arguments — just type whoami alone.

Running whoami prints one line — a current login username, like taro. It's especially useful on a server shared by multiple people.

A common early mistake is not noticing you're working as the root user, and performing an operation with more power than you intended. Building a habit of checking with whoami before risky operations matters.

In real work, this is used a lot when hopping between multiple servers over SSH, as a way to avoid losing track of "which user am I connected as right now."

Linux
Try it (type this into the pseudo terminal)
whoami

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)