The quickest way to check your username

Open a terminal and type whoami, then press Enter. Ubuntu will print your username on the next line. That is the account name you use to log in.

If you want to see more detail — your user ID number, group ID, and all the groups you belong to — type id instead. This shows the same username plus the numeric identifiers the system uses behind the scenes.

Both commands work whether you are logged in as a regular user or have switched to a different account. They show you who the system thinks you are right now.

Key Takeaways

  • The whoami command prints your username when ready in any terminal.
  • The id command shows your username plus your user ID, group ID, and all groups you belong to.
  • Your username appears in the terminal prompt by default — it is the text before the @ symbol.
  • If you cannot remember your username, check the /etc/passwd file or look at the folder names in /home.

Reading your username from the terminal prompt

When you open a terminal, the prompt usually shows your username automatically. Look at the text on the left side of the screen before the @ symbol. If your prompt reads james@ubuntu-desktop:~$, then your username is james.

Some systems hide the username in the prompt if you customize it, or if you are using a minimal shell. In those cases, whoami is faster than hunting through settings.

Finding all usernames on your system

If you want to see every user account on the Ubuntu machine — not just your own — open a terminal and type cat /etc/passwd. This file lists every account, one per line. The username is the first part of each line, before the first colon.

Most of these are system accounts that Ubuntu creates for services and background tasks. Your personal account will be in the list, usually with a user ID of 1000 or higher. System accounts typically have IDs below 1000.

You can also look in the /home folder. Type ls /home and Ubuntu will list the folder names — each folder name is a username with a home directory on this machine.

Checking which groups you belong to

Your username is one piece of your identity. You also belong to one or more groups, which control what you can do. Type groups in the terminal to see all the groups attached to your account.

If you see a group called sudo, you can run commands as the administrator. If you see docker, you can use Docker containers without typing a password each time. The adm group lets you read system logs.

To see the groups for a different user, type groups username — replace username with the actual name. This is useful if you are troubleshooting why another account cannot do something.

Finding your username if you forgot it

If you cannot remember your username, the fastest route is to open a terminal and type whoami. If you are already logged in, the system knows who you are.

If you are locked out and cannot log in, restart the machine and hold Shift while it boots. This opens the GRUB menu. Select "Advanced options for Ubuntu" and then choose a recovery mode option. From there you can access a root shell and type ls /home to see which user accounts exist.

You can also check the file /etc/passwd directly from recovery mode. Look for lines with user IDs of 1000 or higher — those are the personal accounts, not system accounts.

Understanding the difference between username and display name

Your username is what you type to log in and what whoami shows you. It has no spaces and is usually all lowercase. Your display name is different — it is the full name that appears in the user menu and in file properties.

The display name might be "James Rodriguez" while your username is "jrodriguez". When you run whoami or id, you see the username, not the display name. The system uses the username for permissions, file ownership, and login.

If you want to change your display name without changing your username, you can do that through Settings under Details. Your username stays the same, so all your files and permissions keep working.

Frequently Asked Questions

What if whoami shows "root"?

You are logged in as the root user, the administrator account with full system access. Most of the time you should not be root — type exit to return to your regular account, or open a new terminal window. If you need to run a single command as root, use sudo instead.

Can I change my username?

Yes, but it is complicated because your username is tied to your home folder, file ownership, and permissions throughout the system. The safest way is to create a new user account with the name you want, move your files over, and delete the old account. Ubuntu's Settings app does not have a built-in rename function for this reason.

Why does the id command show multiple groups?

Groups control what you can do on the system. You belong to your primary group (usually named after your username) plus any additional groups an administrator added you to. Each group grants different permissions — for example, the sudo group lets you run administrator commands.

What if I see a username I do not recognize in /etc/passwd?

Most usernames in that file are system accounts created by Ubuntu for services like mail, printing, or databases. They are not people — they are accounts that background processes use. Personal user accounts are usually in the /home folder and have user IDs of 1000 or higher.